-
Notifications
You must be signed in to change notification settings - Fork 72
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
axis 2 is out of bounds for array of dimension 1 #25
Comments
I have the same problem as you! |
Did you manage to run the code yet? |
What you want I will tell u short method. This is very heavy project and some of code has been deleted. So try something else method. Or give me overview I will guid u |
1 similar comment
What you want I will tell u short method. This is very heavy project and some of code has been deleted. So try something else method. Or give me overview I will guid u |
First of all thabks for showing the interest in this. Actually I mentioned this topic to my mentor for my college project just by seeing the code. I thought it will work but when i saw you issue i think i made a mistake. Can you please help me finding the way to run this code or any other code related to Alzheimer prediction. |
Yes, I tried the code much time and debug and try to remove that shity bug but unfortunately, it missing some file and a portion of the code.
than write coding for your project data preparing and preprocessing and then finally make a robust DL modal for your data which classifies into 3 or 4 classes. |
Thanks for the explanation man. Just wanted to know that if this code has everything thing you said like converting 3d to 2d and the modal code thrn what part is missing.I mean i dont have that much time that i can do the whole code from scratch. If you have done any work regarding this then please help me with the code. Thank you |
I am using your code I don't know why its not running smooth many errors removed but still getting this error please specify the reason why its is happening??
My preferences
python 3.7
anaconda
installed all libraries which are required .
Here I am getting the error
runfile('C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master/main_alexnet.py', wdir='C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master')
Reloaded modules: custom_transform2D, AD_Dataset, AD_Standard_2DSlicesData, AD_Standard_2DRandomSlicesData
2020-02-04 10:22:24 INFO: At 0-th epoch.
Traceback (most recent call last):
File "", line 1, in
runfile('C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master/main_alexnet.py', wdir='C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master')
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master/main_alexnet.py", line 238, in
main(options)
File "C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master/main_alexnet.py", line 134, in main
train_loss, correct_cnt = train(model, train_loader, use_cuda, criterion, optimizer, train_loss_f)
File "C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master/main_alexnet.py", line 162, in train
for it, train_data in enumerate(train_loader):
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 345, in next
data = self._next_data()
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 385, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\Ali ktk.spyder-py3\AD_Prediction-master new\AD_Prediction-master\AD_Standard_2DRandomSlicesData.py", line 60, in getitem
image2D = self.transform(image2D)
File "C:\ProgramData\Anaconda3\lib\site-packages\torchvision\transforms\transforms.py", line 70, in call
img = t(img)
File "C:\Users\Ali ktk.spyder-py3\AD_Prediction-master new\AD_Prediction-master\custom_transform2D.py", line 39, in call
img = torch.from_numpy(pic.transpose((2, 0, 1)))
ValueError: axes don't match array
runfile('C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master/main_alexnet.py', wdir='C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master')
Reloaded modules: custom_transform2D, AD_Dataset, AD_Standard_2DSlicesData, AD_Standard_2DRandomSlicesData, AD_Standard_2DTestingSlices, AlexNet2D
2020-02-04 10:23:12 INFO: At 0-th epoch.
Traceback (most recent call last):
File "", line 1, in
runfile('C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master/main_alexnet.py', wdir='C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master')
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master/main_alexnet.py", line 238, in
main(options)
File "C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master/main_alexnet.py", line 134, in main
train_loss, correct_cnt = train(model, train_loader, use_cuda, criterion, optimizer, train_loss_f)
File "C:/Users/Ali ktk/.spyder-py3/AD_Prediction-master new/AD_Prediction-master/main_alexnet.py", line 162, in train
for it, train_data in enumerate(train_loader):
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 345, in next
data = self._next_data()
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data\dataloader.py", line 385, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\ProgramData\Anaconda3\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\Ali ktk.spyder-py3\AD_Prediction-master new\AD_Prediction-master\AD_Standard_2DRandomSlicesData.py", line 53, in getitem
AXimageList = axRandomSlice(image)
File "C:\Users\Ali ktk.spyder-py3\AD_Prediction-master new\AD_Prediction-master\AD_Standard_2DRandomSlicesData.py", line 87, in axRandomSlice
return getRandomSlice(image_array, AX_INDEX, AX_SCETION)
File "C:\Users\Ali ktk.spyder-py3\AD_Prediction-master new\AD_Prediction-master\AD_Standard_2DRandomSlicesData.py", line 81, in getRandomSlice
slice_2Dimg = np.stack((slice_select_0, slice_select_1, slice_select_2), axis = 2)
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\shape_base.py", line 419, in stack
axis = normalize_axis_index(axis, result_ndim)
AxisError: axis 2 is out of bounds for array of dimension 1
The text was updated successfully, but these errors were encountered: