-
Notifications
You must be signed in to change notification settings - Fork 414
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
Missing key(s) in state_dict error when testing the pretrained models #24
Comments
Hi, you can't get the segmentation result when using the segmentation test code in the situation you mentioned since "resnet_50_23dataset.pth" and "resnet_50.pth" are just backbones without segmentation head. |
Alright. Could you kindly show me how to add necessary segmentation heads to the backbone? |
you need to change the 'shortcut' parameter in Resnet class settings when you use different depth of resnet. At the same time, you need to comment out the self.conv_seg variable when init the class. |
I have been struggling with this myself, if I comment out the self.conv_seg then I can't use the pretrained resnet_50_epoch model right? Also, I have an issue with the resnet_50_epoch model where it has 2 classes specified but I need 1 class only. Any ideas how to approach this? |
I haven't test it on resnet50, but on resnet 10, resnet 18 and resnet34, comment out the self.conv_seg worked well. Attention you need to change to 'shortcut'. I don't have any idea of the following question if you only need you class maybe this pretrained model do not fit your needs. |
Hi,
thank you for sharing your excellent work!
I wanna test your pre-trained lung segmentation model (this release) with my CT data, and I encountered the following error when running "python test.py --gpu_id 0 --resume_path pretrain/resnet_50_23dataset.pth --img_list data/val.txt":
The same error persists when I replace "--resume_path pretrain/resnet_50_23dataset.pth" with "--resume_path pretrain/resnet_50.pth". It does not work by adding "--model resnet --model_depth 50 --resnet_shortcut B".
However, it works when I use another pre-trained model instead: "--resume_path trails/resnet_50_epoch_200_batch_0.pth.tar".
Would appreciate your advice on how to make the pre-trained models work. My environment:
Thanks!
Wei
The text was updated successfully, but these errors were encountered: