question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ir_csn_152 size mismatch: Error(s) in loading state_dict for VideoResNet

See original GitHub issue

I follow the installation guide to install VMZ locally. When I try to load the pretrained ir_csn_152 model to PyTorch: from vmz.models import ir_csn_152 model = ir_csn_152(pretraining="ig65m_32frms") I received an error saying that there is a size mismatch with fc.weight and fc.bias. I assumed this is a bug where the finetuned model was given the pretrained model weights or vice versa. image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
KhHTrancommented, Sep 23, 2021

You load an empty model then load the state of the pre-trained model. `url = ‘https://github.com/bjuncek/VMZ/releases/download/test_models/irCSN_152_ft_kinetics_from_ig65m_f126851907.pth’ dic = torch.hub.load_state_dict_from_url(url, progress = True)

model = ir_csn_152() model.load_state_dict(dic)`

0reactions
GriesserPcommented, Sep 23, 2021

I’m not sure. But you can solve the issue pretty easily.

Hello, could you give the solution please ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error(s) in loading state_dict for BeitForImageClassification ...
RuntimeError: Error(s) in loading state_dict for BeitForImageClassification: size mismatch for classifier.weight #13127.
Read more >
Error(s) in loading state_dict for GoogLeNet: size mismatch ...
Currently I am trying to load my pretrained GoogleNet. However, there seems to be a size mismatch problem, I tried changed the num_classes ......
Read more >
Sec. 152. Dependent Defined - Internal Revenue Code
I.R.C. § 152(b)(2) Married Dependents —. An individual shall not be treated as a dependent of a taxpayer under subsection (a) if such...
Read more >
Load_enc size mismatch error - Part 2 & Alumni (2018)
RuntimeError: Error(s) in loading state_dict for MultiBatchRNNCore: size mismatch for encoder.weight: copying a param with shape torch.
Read more >
26 U.S. Code § 152 - Dependent defined - Law.Cornell.Edu
the noncustodial parent attaches such written declaration to the noncustodial parent's return for the taxable year beginning during such calendar year. (3) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found