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

loading the parameters #11

Open
OfirKedem opened this issue May 6, 2018 · 5 comments
Open

loading the parameters #11

OfirKedem opened this issue May 6, 2018 · 5 comments

Comments

@OfirKedem
Copy link

OfirKedem commented May 6, 2018

Hi zoogzog
I've been trying to run your code but it seems the DenseNet121 module has been changed.
meaning your parameters are saved under the name:
module.densenet121.features.denseblock1.denselayer1.norm.1.bias
------------------------------------------------------------------------------------^----------
while the module is telling me it's missing:
module.densenet121.features.denseblock1.denselayer1.norm1.bias

i believe that little dot there is messing everything up...
do you have an idea how to solve it? loading an old DenseNet121 module or perhaps updating the parameters names?

i think retraining the model can fix it but I'm trying to save time and avoid training for now.

thanks in advance,
a very desperate student :)

@zoogzog
Copy link
Owner

zoogzog commented May 16, 2018

If you want to use the trained model, I think the quickest solution would be to use the older version of the DenseNet implementation.

@zoukai214
Copy link

I met the same problem. Have you solved it? @OfirKedem

@OfirKedem
Copy link
Author

Yes i have. You need to roll back torch and torchvision. Use this versions:
image

@dgrechka
Copy link

dgrechka commented Aug 1, 2019

Spent some time trying to find torch v0.3.1 for windows. bad luck. It is not available anymore.
So pretrained weights are not usable.

@mshmoon
Copy link

mshmoon commented May 13, 2020

This happend is because the high version pytorch define model keys as convX. or normX., but in the low version pytorch define model keys as conv.X. or norm.X., they are defference, so you should define keys as the same name.

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