shiyinzhang / Inside-Outside-Guidance

Interactive Object Segmentation with Inside-Outside Guidance
217 stars 34 forks source link

What pretrained model to use? #6

Open nathantew14 opened 3 years ago

nathantew14 commented 3 years ago

In train.py, the code attempts to load a pretrained model by calling Network(). The default path to the pretrained model in the code in mypath.py is '/path/to/models/resnet101-5d3b4d8f.pth', but no such file is found. I assumed the user had to insert the actual path manually, so I tried to do so with both pretrained models provided in the readme.md file, namely IOG_PASCAL.pth and IOG_PASCAL_SBD.pth, but both returned error:

KeyError: 'conv1.weight'

Are those the right pretrained models to use? If not, what are? Thanks.

P.S. Looking forward to the demo code, any ETA?

shiyinzhang commented 3 years ago

You can download resnet101-5d3b4d8f.pth at 'https://download.pytorch.org/models/resnet101-5d3b4d8f.pth'. When you test on the pretrained models named IOG_PASCAL_SBD.pth,you need to change the ‘pretrain_dict = torch.load(os.path.join(save_dir, 'models', modelName + '_epoch-' + str(resume_epoch - 1) + '.pth'))’ to ‘pretrain_dict = torch.load( '/path/to/IOG_PASCAL_SBD.pth')’ in test.py. If you want to finetune on the pretrained models named IOG_PASCAL_SBD.pth,you need to modify the lines 63-70 in train.py.