size mismatch when loading the trained checkpoint
See original GitHub issueFor the adaptation from VOC to watercolor, VOC has 21 classes (background included) and the watercolor dataset has 7 classes, how do you deal with the inconsistency? It seems that the classifier obtained in the training stage cannot be applied for the test stage. Thanks.
*** RuntimeError: Error(s) in loading state_dict for resnet:
size mismatch for RCNN_cls_score.weight: copying a param of torch.Size([7, 2304]) from checkpoint, where the shape is torch.Size([21, 2304]) in current model.
size mismatch for RCNN_cls_score.bias: copying a param of torch.Size([7]) from checkpoint, where the shape is torch.Size([21]) in current model.
size mismatch for RCNN_bbox_pred.weight: copying a param of torch.Size([28, 2304]) from checkpoint, where the shape is torch.Size([84, 2304]) in current model.
size mismatch for RCNN_bbox_pred.bias: copying a param of torch.Size([28]) from checkpoint, where the shape is torch.Size([84]) in current model.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
size mismatch when loading checkpoint (ssf2020) #113 - GitHub
I am trying to load a checkpoint after training the ssf2020 model. However, when I load the checkpoint, a size mismatch error occurs....
Read more >Size Mismatch Runtime Error When Trying to Load a PyTorch ...
It seems to me that your model configuration does not match the content of the model checkpoint. I imagine your model has parameters...
Read more >Training my pretrained model in different dataset and I got an ...
Size ([6, 128]) from checkpoint, the shape in current model is torch.Size([7, 128]). size mismatch for crop_encoder.bn2.embed.weight: copying a ...
Read more >Intro-to-PyTorch: Saving and Loading Models | Kaggle
Size ([512]) from checkpoint, the shape in current model is torch.Size([400]). size mismatch for hidden_layers.1.weight: copying a param with shape torch.Size([ ...
Read more >T5ForConditionalGeneration checkpoint size mismatch #19418
Loading the model. This is how I'm loading the model: tokenizer = T5Tokenizer.from_pretrained(args["model_checkpoint"], bos_token=" ...
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 have the same questions
Have you solved the problem?