Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
takrouni opened this issue Feb 6, 2019 · 6 comments

Comments

@takrouni
Copy link

takrouni commented Feb 6, 2019

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
Copy link

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

@gopalmani
Copy link

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

@karthikr87
Copy link

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
Copy link

rajdadia commented Apr 14, 2019

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

@sapnii2
Copy link

sapnii2 commented May 25, 2019

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

@ruchika61
Copy link

I faced the same problem . Please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants