Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dimension problem #8

Open
michaelzhang917 opened this issue May 25, 2018 · 2 comments
Open

Dimension problem #8

michaelzhang917 opened this issue May 25, 2018 · 2 comments

Comments

@michaelzhang917
Copy link

I have downloaded the following checkpoint for Bn inception model but can't use it.
Do you know how to resolve this extra dimension issue?
Thanks!

https://yjxiong.blob.core.windows.net/models/bn_inception-9f5701afb96c8044.pth
Traceback (most recent call last):
File "main.py", line 322, in
main()
File "main.py", line 38, in main
partial_bn=not args.no_partialbn)
File "/home/vbalab/projects/SimpleMovementDetection/TRN-pytorch/models.py", line 43, in init
self._prepare_base_model(base_model)
File "/home/vbalab/projects/SimpleMovementDetection/TRN-pytorch/models.py", line 108, in _prepare_base_model
self.base_model = getattr(model_zoo, base_model)()
File "/home/vbalab/projects/SimpleMovementDetection/TRN-pytorch/model_zoo/bninception/pytorch_load.py", line 35, in init
self.load_state_dict(torch.utils.model_zoo.load_url(weight_url), strict=False)
File "/home/vbalab/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 721, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for BNInception:
While copying the parameter named "conv1_7x7_s2_bn.weight", whose dimensions in the model are torch.Size([64]) and whose dimensions in the checkpoint are torch.Size([1, 64]).
While copying the parameter named "conv1_7x7_s2_bn.bias", whose dimensions in the model are torch.Size([64]) and whose dimensions in the checkpoint are torch.Size([1, 64]).
While copying the parameter named "conv1_7x7_s2_bn.running_mean", whose dimensions in the model are torch.Size([64]) and whose dimensions in the checkpoint are torch.Size([1, 64]).
While copying the parameter named "conv1_7x7_s2_bn.running_var", whose dimensions in the model are torch.Size([64]) and whose dimensions in the checkpoint are torch.Size([1, 64]).
While copying the parameter named "conv2_3x3_reduce_bn.weight", whose dimensions in the model are torch.Size([64]) and whose dimensions in the checkpoint are torch.Size([1, 64]).
While copying the parameter named "conv2_3x3_reduce_bn.bias", whose dimensions in the model are torch.Size([64]) and whose dimensions in the checkpoint are torch.Size([1, 64]).

@Cadene
Copy link
Owner

Cadene commented May 27, 2018

@michaelzhang917 Please consider using https://github.com/Cadene/pretrained-models.pytorch instead.

@qiuhaohao
Copy link

qiuhaohao commented Jun 19, 2018

@michaelzhang917 If you got the problem from this repo, try using torch 0.3.1 instead of 0.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants