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

Using mmcv to load model with unmatched weight dimensions #1

Open
linjieyangsc opened this issue Jun 2, 2019 · 3 comments
Open

Using mmcv to load model with unmatched weight dimensions #1

linjieyangsc opened this issue Jun 2, 2019 · 3 comments

Comments

@linjieyangsc
Copy link

linjieyangsc commented Jun 2, 2019

When using mmcv to load pytorch model with unmatched weight dimensions, it will raise an exception. Make the following change to load such a model.

# [python_lib_path]/site-packages/mmcv/runner/checkpoint.py
# L53, change to print
            print('While copying the parameter named {}, '
                  'whose dimensions in the model are {} and '
                  'whose dimensions in the checkpoint are {}.'
                  .format(name, own_state[name].size(),
                          param.size()))
@FinalFlowers
Copy link

@linjieyangsc What does that mean? How to change it?

@linjieyangsc
Copy link
Author

@FinalFlowers sorry for the confusion. You need to edit this file in your python instsall path
[python_lib_path]/site-packages/mmcv/runner/checkpoint.py
And modify the Line53 with the above changes.

@CocoRLin
Copy link

Hi!Thanks for reminding this problem!
I wonder which version of mmcv do you use?

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