Hi Experts,
I’m a researcher in the filed of neuroscience using MRI techniques.
I’m new to pyhton and tensorflow.
I have the same question raised by Dr. Roger ( @rogiedodgie).
I’m trying to analyze MRI data with use of the following a python-based code (GitHub - pboutinaud/SHIVA_PVS: Perivascular (PVS) or Virchow–Robin Spaces (VRS) segmentation with a 3D Unet). This code computes with use of the 3D U-Shaped Neural Network that was already trained with the pre-exsiting data in machine-learning procedure (Frontiers | 3D Segmentation of Perivascular Spaces on T1-Weighted 3 Tesla MR Images With a Convolutional Autoencoder and a U-Shaped Neural Network). This code demands the tensorflow for computaion.
I’m using python3.10 on mac terminal and installed the tensorflow 2.15.0.
Mac OS is ventura 13.6.1.
I reached this website and read the suggestions from the Team members, but I did not understand.
Could you tell me the solution if you have already fixed ? Or I would greatly appreciate if you could give me suggestions with consiring me as a biginner. I want to achive successful analysis with use of this code.
The code history as follows:
input the folliwing:
python3 /Users/username/Downloads/SHIVA_PVS/predict_one_file.py -i /Users/username/mri/young_healthy/MRI_resliced.nii -m /Users/username/Downloads/SHIVA_PVS/PVS/v1/T1.PVS/20211030-162753_Unet3Dv2-10.7.2-1.8-T1.VRS_fold_1x6_pi_fold_0_model.h5 -b /Users/username/mri/young_healthy/brain_reslice.nii -o /Users/username/mri/young_healthy/pv_MRI_resliced --verbose --gpu 0
terminal returns:
2023-11-16 07:55:41.891278: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Trying to run inference on GPU 0
WARNING:tensorflow:Mixed precision compatibility check (mixed_float16): WARNING
The dtype policy mixed_float16 may run slowly because this machine does not have a GPU. Only Nvidia GPUs with compute capability of at least 7.0 run quickly with mixed_float16.
If you will use compatible GPU(s) not attached to this host, e.g. by running a multi-worker model, you can ignore this warning. This message will only be logged once
INFO : Predicting fold : 20211030-162753_Unet3Dv2-10.7.2-1.8-T1.VRS_fold_1x6_pi_fold_0_model
Traceback (most recent call last):
File “/Users/username/Downloads/SHIVA_PVS/predict_one_file.py”, line 125, in
prediction = model.predict(
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/keras/src/utils/traceback_utils.py”, line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/tensorflow/python/eager/execute.py”, line 53, in quick_execute
tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.InvalidArgumentError: No OpKernel was registered to support Op ‘MaxPool3D’ used by {{node model/Enc_Max_D7/MaxPool3D}} with these attrs: [T=DT_HALF, data_format=“NDHWC”, ksize=[1, 2, 2, 2, 1], strides=[1, 2, 2, 2, 1], padding=“VALID”]
Registered devices: [CPU]
Registered kernels:
device=‘XLA_CPU_JIT’; T in [DT_FLOAT, DT_BFLOAT16, DT_HALF]
device=‘CPU’; T in [DT_FLOAT]
device=‘CPU’; T in [DT_BFLOAT16]