You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
您好,非常感谢您的工作,收获很多,我在使用您给的Synapse权重尝试直接进行测试得到预测的分割图像时一直报错,如下所示: Traceback (most recent call last): File "/data/cy-codes/MT-UNet-main/test_Synapse.py", line 23, in <module> model.load_state_dict(torch.load(args.checkpoint)) File "/data/miniconda/envs/torch/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2041, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for MTUNet: size mismatch for SegmentationHead.weight: copying a param with shape torch.Size([9, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([4, 64, 1, 1]). size mismatch for SegmentationHead.bias: copying a param with shape torch.Size([9]) from checkpoint, the shape in current model is torch.Size([4]).
我已经设置了num_classes的值为9,但是仍然报错,所以想向您请教,当然如果您能提供MT-UNet预测的分割结果,我会不胜感激,我的邮箱是allure0719@163.com,非常感谢!!
The text was updated successfully, but these errors were encountered:
Hi @Candice-Y and thank you for your question. Seems like you are trying to use ACDC weights for Synapse validation. This will cause a size mismatch for the classifier of MT-UNet as ACDC weights is for 4-class classification task. You can simply change to use our provided Synapse weights for this task.
您好,非常感谢您的工作,收获很多,我在使用您给的Synapse权重尝试直接进行测试得到预测的分割图像时一直报错,如下所示:
Traceback (most recent call last): File "/data/cy-codes/MT-UNet-main/test_Synapse.py", line 23, in <module> model.load_state_dict(torch.load(args.checkpoint)) File "/data/miniconda/envs/torch/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2041, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for MTUNet: size mismatch for SegmentationHead.weight: copying a param with shape torch.Size([9, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([4, 64, 1, 1]). size mismatch for SegmentationHead.bias: copying a param with shape torch.Size([9]) from checkpoint, the shape in current model is torch.Size([4]).
我已经设置了num_classes的值为9,但是仍然报错,所以想向您请教,当然如果您能提供MT-UNet预测的分割结果,我会不胜感激,我的邮箱是allure0719@163.com,非常感谢!!
The text was updated successfully, but these errors were encountered: