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

I met this error when run with my data. #22

Open
bemoregt opened this issue Aug 10, 2021 · 11 comments
Open

I met this error when run with my data. #22

bemoregt opened this issue Aug 10, 2021 · 11 comments

Comments

@bemoregt
Copy link

HI, @lee-zq

I met this error when run with my data.

My data is brain MRI OASIS data (nii file format).

What's wrong to me?

...
)
(map1): Sequential(
(0): Conv3d(256, 2, kernel_size=(1, 1, 1), stride=(1, 1, 1))
(1): Upsample(scale_factor=(8.0, 8.0, 8.0), mode=trilinear)
(2): Softmax(dim=1)
)
)
Total number of parameters: 9498744
=======Epoch:1=======lr:0.0001
0%| | 0/3 [00:00<?, ?it/s]torch.Size([2, 1, 48, 128, 128]) torch.Size([2, 48, 128, 128])
0%| | 0/3 [00:01<?, ?it/s]
Traceback (most recent call last):
File "/Users/tessor2/3DUNet-Pytorch/train.py", line 94, in
train_log = train(model, train_loader, optimizer, loss, args.n_labels, alpha)
File "/Users/tessor2/3DUNet-Pytorch/train.py", line 46, in train
target = common.to_one_hot_3d(target,n_labels)
File "/Users/tessor2/3DUNet-Pytorch/utils/common.py", line 9, in to_one_hot_3d
one_hot = torch.zeros(n, n_classes, s, h, w).scatter_(1, tensor.view(n, 1, s, h, w), 1)
RuntimeError: index 243 is out of bounds for dimension 1 with size 2
E

Thanks in advance ~

Best,
@bemoregt.

@alongGS
Copy link

alongGS commented Nov 4, 2021

same question...

@alongGS
Copy link

alongGS commented Nov 4, 2021

and i fixed it py checking my segmentation data( finding two label3, but i have not label3), hope help you

@bastian110
Copy link

Hi, I have the same question.
Did you fixed it?

@jielingao
Copy link

看起来是输入图像的维度不匹配,看下原始mri的数据是不是多期

@QianLingjun
Copy link

网络输入与输出的不匹配是在模型地方就存在了bug,输入256256,但是输出最后一层是512512,希望作者可以看下这里的问题,谢谢

@xyf9474
Copy link

xyf9474 commented Feb 18, 2022

网络输入与输出的不匹配是在模型地方就存在了bug,输入256_256,但是输出最后一层是512_512,希望作者可以看下这里的问题,谢谢

上采样那里括号里三个数字都改成和第一个数字一样就行了(8,8,8)这样

@Betty-J
Copy link

Betty-J commented Mar 4, 2022

您好,请问您找到解决方法了吗

@life-8079
Copy link

您好,请问您找到解决方法了吗
类别数超过索引了,在common.py中tensor下面加一行tensor[tensor > 1] =1

@Betty-J
Copy link

Betty-J commented Mar 22, 2022

您好,请问您找到解决方法了吗
类别数超过索引了,在common.py中tensor下面加一行tensor[tensor > 1] =1
好的,谢谢回复

@linsan1uz
Copy link

能解释一下吗 我加了这行代码我的tumor_dice一直是0

@johnchen99
Copy link

能解释一下吗 我加了这行代码我的tumor_dice一直是0

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

10 participants