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

resnet50_v1c weight not match #21

Closed
wangziyukobe opened this issue Feb 26, 2019 · 6 comments
Closed

resnet50_v1c weight not match #21

wangziyukobe opened this issue Feb 26, 2019 · 6 comments

Comments

@wangziyukobe
Copy link

Thanks to your great work!
I tried to run pspnet according to your instructions. I downloaded 'resnet50_v1c' from gluon and converted it to pytorch model by running 'python gluon2pytorch.py -m 'resnet50_v1c'. But when I tried to run the pspnet by command 'python train.py -d 0-7', it shows that the weight of the checkpoint does not match that of the current model. The log is as following:
RuntimeError: Error(s) in loading state_dict for ResNet:
size mismatch for conv1.0.weight: copying a param with shape torch.Size([32, 3, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 3, 3, 3]).
size mismatch for conv1.1.weight: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for conv1.1.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for conv1.1.running_mean: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for conv1.1.running_var: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for conv1.3.weight: copying a param with shape torch.Size([32, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([64, 64, 3, 3]).
size mismatch for conv1.4.weight: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for conv1.4.bias: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for conv1.4.running_mean: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for conv1.4.running_var: copying a param with shape torch.Size([32]) from checkpoint, the shape in current model is torch.Size([64]).
size mismatch for conv1.6.weight: copying a param with shape torch.Size([64, 32, 3, 3]) from checkpoint, the shape in current model is torch.Size([128, 64, 3, 3]).
size mismatch for bn1.weight: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for bn1.bias: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for bn1.running_mean: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for bn1.running_var: copying a param with shape torch.Size([64]) from checkpoint, the shape in current model is torch.Size([128]).
size mismatch for layer1.0.conv1.weight: copying a param with shape torch.Size([64, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([64, 128, 1, 1]).
size mismatch for layer1.0.downsample.0.weight: copying a param with shape torch.Size([256, 64, 1, 1]) from checkpoint, the shape in current model is torch.Size([256, 128, 1, 1]).
Could you help me find out where it goes wrong? Thanks very much!

@ycszen
Copy link
Owner

ycszen commented Mar 5, 2019

Hi, thanks for your attention. I have checked the pre-trained model in Gluon. Now the pre-trained model in Gluon has changed some setting in the model. Therefore, if you have to use the converted model, you need to change the resnet code in the base_model folder correspondingly. Or I will publish the pre-trained model recently.

@Dorispaopao
Copy link

when will you publish the pre-trained model ?and where can I download the resnet101_v1c.pth?

@timehasspeed
Copy link

timehasspeed commented May 3, 2019

i have the same problem ,if you have solved , can you tell me how to do ?
thanks very much

@timehasspeed
Copy link

when will you publish the pre-trained model ?and where can I download the resnet101_v1c.pth?

you can find urls on the pyt_utils.py ,

@danny95333
Copy link

when will you publish the pre-trained model ?and where can I download the resnet101_v1c.pth?

you can find urls on the pyt_utils.py ,

I think the .pth in pyt_utils.py are original Resnet101's weight which is different with Resnet101_v1c.

@ycszen
Copy link
Owner

ycszen commented Aug 1, 2019

I have released the pre-trained models.
Welcome to using them~

@ycszen ycszen closed this as completed Aug 1, 2019
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

5 participants