intel / unet

U-Net Biomedical Image Segmentation
Apache License 2.0
306 stars 125 forks source link

issue regarding change in dataset #30

Closed owaisali7293 closed 3 years ago

owaisali7293 commented 3 years ago

I am using unet provided by intel and successfully used it for BRATS but when ever i change the dataset this error occurs at the stage where i am running inference using IR files

Data batch channel count (4) does not match filter input channel count (1).

(decathlon) E:\code3\unet-master\2D>python plot_openvino_inference_examples.py --device MYRIAD 2021-01-31 12:28:08.797145: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found 2021-01-31 12:28:08.797355: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. Traceback (most recent call last): File "plot_openvino_inference_examples.py", line 137, in seed=args.seed) File "E:\code3\unet-master\2D\dataloader.py", line 39, in init self.file_list = tf.io.gfile.glob(self.dirName) File "C:\Users\owais\anaconda3\envs\decathlon\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 371, in get_matching_files_v2 compat.as_bytes(pattern)) tensorflow.python.framework.errors_impl.NotFoundError: FindFirstFile failed for: ../data/decathlon/Task01_BrainTumour/2D_model/testing : The system cannot find the path specified. ; No such process

(decathlon) E:\code3\unet-master\2D>python plot_openvino_inference_examples.py --device MYRIAD 2021-01-31 12:29:54.101117: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found 2021-01-31 12:29:54.107419: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. Traceback (most recent call last): File "plot_openvino_inference_examples.py", line 147, in net = ie.read_network(model=path_to_xml_file, weights=path_to_bin_file) File "ie_api.pyx", line 261, in openvino.inference_engine.ie_api.IECore.read_network File "ie_api.pyx", line 285, in openvino.inference_engine.ie_api.IECore.read_network RuntimeError: Check 'Dimension::merge(merged_channel_count, data_channel_count, filter_input_channel_count)' failed at C:\j\workspace\private-ci\ie\build-windows-vs2019@2\b\repos\openvino\ngraph\core\src\validation_util.cpp:344: While validating node 'v1::Convolution Convolution_2 (mrimages[0]:f16{1,4,128,128}, StatefulPartitionedCall/2DUNet_Brats_Decathlon/encodeAa/Conv2D/Transpose5219_const[0]:f16{32,1,3,3}) -> (dynamic?)' with friendly_name 'Convolution_2': Data batch channel count (4) does not match filter input channel count (1).

tonyreina commented 3 years ago

Just pass the FLAIR channel (channel 0) to the model. It looks like currently you are passing all 4 MRI channels, but the model was only trained on a single channel.

e.g. mri_data[...,[0]] # Gets just channel 0

b3r-prog commented 2 years ago

@owaisali7293 how did you resolve this?