Res2Net / Res2Net-PretrainedModels

(ImageNet pretrained models) The official pytorch implemention of the TPAMI paper "Res2Net: A New Multi-scale Backbone Architecture"
https://mmcheng.net/res2net/
1.07k stars 215 forks source link

load model issue #22

Closed XiaoHao-Chen closed 4 years ago

XiaoHao-Chen commented 4 years ago

Thank you for your excellent work. Just like issue 5, I ran into the same problem and added "strict = False" to the solution you gave, but the problem still hasn't been solved and the same error still occurs. I tried to load res2net-50-26w-4s. Look forward to your reply. cuda:8.0 python:3.6 pytorch:0.4.0 torchvision:0.1.18

gasvn commented 4 years ago

Have you tried to run 'python res2net.py' directly? Or you can share with me an example code, so I can check where the problem is.

gasvn commented 4 years ago

https://github.com/Res2Net/Res2Net-PretrainedModels/issues/5#issuecomment-590436928 maybe this solution can help you.

XiaoHao-Chen commented 4 years ago

#5 (comment) maybe this solution can help you.

I try to solve this problem, but the same mistake will occur.

XiaoHao-Chen commented 4 years ago

5%GZ`930RN7}RXKDBPDU284

gasvn commented 4 years ago

It seems that torch0.4.1 is a little different with torch0.4.0. You can upgrade from torch0.4.0 to torch0.4.1 or higher version to solve this problem. ref: https://discuss.pytorch.org/t/solved-unexpected-key-s-in-state-dict-batches-tracked/23884

XiaoHao-Chen commented 4 years ago

When I run 'python res2net.py' directly,the same issue will occur. I will try to upgrade the pytorch. Thank you for your prompt reply.

XiaoHao-Chen commented 4 years ago

Updating the version of pytorch can solve the problem. Thank you.