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

Generic_UNetPlusPlus测试报错 #82

Open
axjing opened this issue May 19, 2022 · 0 comments
Open

Generic_UNetPlusPlus测试报错 #82

axjing opened this issue May 19, 2022 · 0 comments

Comments

@axjing
Copy link

axjing commented May 19, 2022

Traceback (most recent call last):
File "/home/dell/jing/Coding/ref/pytorch/nnunet/network_architecture/generic_UNetPlusPlus.py", line 534, in
print(modelGUN(img))
File "/home/dell/anaconda3/envs/jing/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/dell/jing/Coding/ref/pytorch/nnunet/network_architecture/generic_UNetPlusPlus.py", line 399, in forward
x0_1 = self.loc4[0](torch.cat([x0_0, self.up40], 1))
RuntimeError: Sizes of tensors must match except in dimension 1. Got 256 and 512 in dimension 2 (The offending index is 1)

代码错误行在generic_UNetPlusPlus.py的399行,原因是x0_0和self.up40的形状差一倍,
应该是这一层的卷积输出的矩阵形状有问题,请问需要怎么解决,谢谢啦!

实例化参数为:
modelGUN = Generic_UNetPlusPlus(input_channels=1, base_num_features=64, num_classes=2, num_pool=5,
num_conv_per_stage=2,
feat_map_mul_on_downscale=2, conv_op=nn.Conv3d,
norm_op=nn.BatchNorm3d, norm_op_kwargs=None,
dropout_op=nn.Dropout3d, dropout_op_kwargs=None,
nonlin=nn.LeakyReLU, nonlin_kwargs=None, deep_supervision=True,
dropout_in_localization=False,
final_nonlin=softmax_helper, weightInitializer=InitWeights_He(1e-2),
pool_op_kernel_sizes=None,
conv_kernel_sizes=None,
upscale_logits=False, convolutional_pooling=False, convolutional_upsampling=False,
max_num_features=None, basic_block=ConvDropoutNormNonlin,
seg_output_use_bias=False)

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

1 participant