faustomilletari / VNet

GNU General Public License v3.0
284 stars 123 forks source link

want to try the lungs images dataset ,but failed #51

Open nikee1 opened 6 years ago

nikee1 commented 6 years ago

hi~ i'm trying to use the lungs image as a dataset to train the network, but it looks like there are some problems. i use python 2.7,cudnn 5.1,cuda8.0, ubuntu 16.04. the lungs images size is 1,119,879,168 bytes . is it too big ? we can't find the problems. and we use the origin images without problems.

problem: lzh@peach-lab:~/vnet/VNet$ python main.py -train /home/lzh/vnet/VNet/Data/Train FILE LIST: ['13.mhd', '22.mhd', '15.mhd', '16.mhd', '23.mhd', '8.mhd', '3.mhd', '6.mhd', '10.mhd', '4.mhd', '14.mhd', '20.mhd', '5.mhd', '19.mhd', '17.mhd', '21.mhd', '18.mhd', '11.mhd', '12.mhd', '9.mhd', '7.mhd'] MetaImage: Read: Cannot open data file Traceback (most recent call last): File "main.py", line 37, in model.train() File "/home/lzh/vnet/VNet/VNet.py", line 106, in train self.dataManagerTrain.loadTrainingData() #loads in sitk format File "/home/lzh/vnet/VNet/DataManager.py", line 62, in loadTrainingData self.loadImages() File "/home/lzh/vnet/VNet/DataManager.py", line 44, in loadImages self.sitkImages[f]=rescalFilt.Execute(sitk.Cast(sitk.ReadImage(join(self.srcFolder, f)),sitk.sitkFloat32)) File "/home/lzh/.local/lib/python2.7/site-packages/SimpleITK/SimpleITK.py", line 8614, in ReadImage return _SimpleITK.ReadImage(*args) RuntimeError: Exception thrown in SimpleITK ReadImage: /tmp/SimpleITK-build/ITK/Modules/IO/Meta/src/itkMetaImageIO.cxx:491: itk::ERROR: MetaImageIO(0xc6a56a0): File cannot be read: /home/lzh/vnet/VNet/Data/Train/13.mhd for reading. Reason: Success

faustomilletari commented 6 years ago

I remember seeing this error before. It is a bug in simpleITK. Try to investigate INSIDE the simple ITK code what has appened. Maybe it is due to something in the mhd.

Alternatively open all your data in 3D-slicer and then click on the button SAVE. With save you will be able to pick a location to save back all the data in some folder and pick also a new format for the data. Maybe you could save them in mha and this might solve your problem.

Fausto

On Jun 7, 2018, at 1:15 AM, nikee1 notifications@github.com wrote:

hi~ i'm trying to use the lungs image as a dataset to train the network, but it looks like there are some problems. i use python 2.7,cudnn 5.1,cuda8.0, ubuntu 16.04. the lungs images size is 1,119,879,168 bytes . is it too big ? we can't find the problems. and we use the origin images without problems.

problem: lzh@peach-lab:~/vnet/VNet$ python main.py -train /home/lzh/vnet/VNet/Data/Train FILE LIST: ['13.mhd', '22.mhd', '15.mhd', '16.mhd', '23.mhd', '8.mhd', '3.mhd', '6.mhd', '10.mhd', '4.mhd', '14.mhd', '20.mhd', '5.mhd', '19.mhd', '17.mhd', '21.mhd', '18.mhd', '11.mhd', '12.mhd', '9.mhd', '7.mhd'] MetaImage: Read: Cannot open data file Traceback (most recent call last): File "main.py", line 37, in model.train() File "/home/lzh/vnet/VNet/VNet.py", line 106, in train self.dataManagerTrain.loadTrainingData() #loads in sitk format File "/home/lzh/vnet/VNet/DataManager.py", line 62, in loadTrainingData self.loadImages() File "/home/lzh/vnet/VNet/DataManager.py", line 44, in loadImages self.sitkImages[f]=rescalFilt.Execute(sitk.Cast(sitk.ReadImage(join(self.srcFolder, f)),sitk.sitkFloat32)) File "/home/lzh/.local/lib/python2.7/site-packages/SimpleITK/SimpleITK.py", line 8614, in ReadImage return _SimpleITK.ReadImage(*args) RuntimeError: Exception thrown in SimpleITK ReadImage: /tmp/SimpleITK-build/ITK/Modules/IO/Meta/src/itkMetaImageIO.cxx:491: itk::ERROR: MetaImageIO(0xc6a56a0): File cannot be read: /home/lzh/vnet/VNet/Data/Train/13.mhd for reading. Reason: Success

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/51, or mute the thread https://github.com/notifications/unsubscribe-auth/AMtsvqViy6pJrVizq1Xq-1ZaSKvVK-xJks5t6OEXgaJpZM4Ud8LM.

nikee1 commented 6 years ago

thank you! it worked ,i changed the format to mha . I have tried your code on the lung dataset without any chance, but unfortunately the test results is bad and it just marked very few blood vessels. So I changed the patch size. I changed the volsize from (128,128,64) to (64,64,64), and also I changed the dim ofthe input data and labels to (64,64,64). Then I met the error:

F0610 17:01:04.776181 23099 reshape_layer.cpp:86] Check failed: top[0]->count() == bottom[0]->count() (2097152 vs. 524288) output count must match input count Check failure stack trace: The dataset has shape: data - 20. labels – 20

I’m a beginner of the neural network. If you can tell me how to correct the error, or you have any good idea about how to improve the accuracy of the lung dataset, I would be appreciate a lot!!

faustomilletari commented 6 years ago

It's hard to say like this.

Why are you using caffe? You could do yourself a favor and use pytorch version of V-Net. Also this version is going to be replaced very soon with a much nicer version written in pytorch...

Fausto

On Jun 10, 2018, at 6:25 AM, nikee1 notifications@github.com wrote:

thank you! it worked ,i changed the format to mha . I have tried your code on the lung dataset without any chance, but unfortunately the test results is bad and it just marked very few blood vessels. So I changed the patch size. I changed the volsize from (128,128,64) to (64,64,64), and also I changed the dim ofthe input data and labels to (64,64,64). Then I met the error:

F0610 17:01:04.776181 23099 reshape_layer.cpp:86] Check failed: top[0]->count() == bottom[0]->count() (2097152 vs. 524288) output count must match input count Check failure stack trace: The dataset has shape: data - 20. labels – 20

I’m a beginner of the neural network. If you can tell me how to correct the error, or you have any good idea about how to improve the accuracy of the lung dataset, I would be appreciate a lot!!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/faustomilletari/VNet/issues/51#issuecomment-396049062, or mute the thread https://github.com/notifications/unsubscribe-auth/AMtsvtmLSZhsiX3fPHSh3l3pKuKo1bOQks5t7R5hgaJpZM4Ud8LM.