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

为什么存储的模型权重的名字前面都有一个module?重新读取模型时需要没有module的,但是实际全是带module的 #34

Open
LW-CVer opened this issue Nov 6, 2020 · 1 comment

Comments

@LW-CVer
Copy link

LW-CVer commented Nov 6, 2020

No description provided.

@midasklr
Copy link

new_state_dict = OrderedDict() for k, v in checkpoint['state_dict'].items(): name = k[7:] # remove module. new_state_dict[name] = v model.load_state_dict(new_state_dict)

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

2 participants