Error while loading weights
See original GitHub issueKeyError: 'unexpected key "module.features.conv0.weight" in state_dict'
I’m using densenet-201-kinetics.pth
file with the densenet.py
file from models folder.
net = densenet.densenet201(sample_size=64, sample_duration=30, num_classes=400)
pretrained_weights = torch.load(pretrained_path)
net.load_state_dict(pretrained_weights['state_dict'])
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Error in loading the model with load_weights in Keras
A Model is more than just the weights, including architecture, losses, metrics and etc. You have two solutions: 1) Go with saving the...
Read more >Why is there a problem when loading saved weights on a model
However when loading the weights, the fit isn't doing anything. The loss stagnates during the entire training.
Read more >OSError: Unable to load weights from pytorch checkpoint file
Hi, everyone. I need some help. I have been developing the Flask website that has embedded one of Transformer's fine-tuned models within it....
Read more >Model saving & serialization APIs - Keras
Only topological loading ( by_name=False ) is supported when loading weights from the TensorFlow format. Note that topological loading differs slightly between ...
Read more >Error while converting keras model to tensorflow saved model
I'm not sure I understand your question correctly. Does the error occur when you are saving the keras model into .h5 file or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I could reproduce the error and solve it. I trained the model using GPUs. So, the model is wrapped by nn.DataParallel. You have to wrap the model using nn.DataParallel before
load_state
.woohoo. thanks a lot! 😄