pspnet-pytorch
pspnet-pytorch copied to clipboard
how to use pretrained models?
In extractors.py, you can find the pre-trained weights in the following URLs: model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth', 'resnet50': 'https://download.pytorch.org/models/resnet50-19c8e357.pth', 'resnet101': 'https://download.pytorch.org/models/resnet101-5d3b4d8f.pth', 'resnet152': 'https://download.pytorch.org/models/resnet152-b121ed2d.pth', } Hope this issue can be closed.
@cardwing when i use resnet pretrained model, it always give tips that lots of layers' weights not given
I have the same problem, I get multiple errors when trying to load the pre-trained resnets. It seems that the checkpoint and the created model layers names and shapes don't match.
EDIT: I solved the issue by changing the function 'load_weights_sequential' as follow:
def load_weights_sequential(target, source_state):
model_to_load= {k: v for k, v in source_state.items() if k in target.state_dict().keys()}
target.load_state_dict(model_to_load)
are those pretrained weights obtained by training on ImageNet?
@alialamiidrissi thanks for your solution, worked!
Hello, does anybody have a trained model and/or test script to test the method? Thanks
@alialamiidrissi thank you for your solution. It woked!