Issam28 / Brain-tumor-segmentation

A deep learning based approach for brain tumor MRI segmentation.
191 stars 63 forks source link

numpy.AxisError: axis2: axis 1 is out of bounds for array of dimension 1 #11

Open takrouni opened 5 years ago

takrouni commented 5 years ago

Hello Issam, I have a problem when I execute the command: python3 extract_patches.py

Result: Using TensorFlow backend. iteration [0] there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/LGG/brats_tcia_pat282_0001 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat222_0122 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat260_0129 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat394_0001 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat265_0001 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat153_0002 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat447_0199 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat231_0001 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat374_0909 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat399_0217 iteration [10] there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat478_0001 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_2013_pat0007_1 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat314_0290 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat117_0001 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/LGG/brats_2013_pat0001_1 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_2013_pat0027_1 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat309_0001 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat448_0001 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat444_0077 there is a problem here!!! the problem lies in this patient : Brats2017/Brats17TrainingData/HGG/brats_tcia_pat230_0481 Traceback (most recent call last): File "extract_patches.py", line 249, in Patches,Y_labels=pipe.sample_patches_randomly(num_patches,d, h, w) File "extract_patches.py", line 87, in sample_patches_randomly gt_im = np.swapaxes(self.train_im, 0, 1)[4] File "/home/wiem/Bureau/tmp/CNNbasedMedicalSegmentation-master/.bashrc/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 585, in swapaxes return _wrapfunc(a, 'swapaxes', axis1, axis2) File "/home/wiem/Bureau/tmp/CNNbasedMedicalSegmentation-master/.bashrc/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc return getattr(obj, method)(*args, **kwds) numpy.AxisError: axis2: axis 1 is out of bounds for array of dimension 1

Please help me

gopalmani commented 5 years ago

i have the same error . did you get this one?? need help

gopalmani commented 5 years ago

Screen Shot 2019-03-14 at 11 42 57 PM

karthikr87 commented 5 years ago

I am facing the same issue. Have you fixed it?

Using TensorFlow backend. Traceback (most recent call last): File "extract_patches.py", line 236, in Patches,Y_labels=pipe.sample_patches_randomly(num_patches,d, h, w) File "extract_patches.py", line 74, in sample_patches_randomly gt_im = np.swapaxes(self.train_im, 0, 1)[4]
File "/usr/local/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 585, in swapaxes return _wrapfunc(a, 'swapaxes', axis1, axis2) File "/usr/local/lib/python3.7/site-packages/numpy/core/fromnumeric.py", line 56, in _wrapfunc return getattr(obj, method)(*args, **kwds) numpy.AxisError: axis2: axis 1 is out of bounds for array of dimension 1

rajdadia commented 5 years ago

Make sure the system has enough RAM and storage and the file path is proper. The same error worked for me.

sapnii2 commented 5 years ago

RAM and storage and the file path is proper but getting error same as takrouni

ruchika61 commented 4 years ago

I faced the same problem . Please help