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

KeyError: 'bert.embeddings.LayerNorm.gamma' #9

Open
fangzhaoyi1995 opened this issue Jan 17, 2022 · 2 comments
Open

KeyError: 'bert.embeddings.LayerNorm.gamma' #9

fangzhaoyi1995 opened this issue Jan 17, 2022 · 2 comments

Comments

@fangzhaoyi1995
Copy link

有人知道这个问题改怎么解决吗
File "F:\software\Anaconda\envs\tensor\lib\site-packages\bert4pytorch\modeling.py", line 71, in load_weights_from_pytorch_checkpoint
state_dict[new_key] = state_dict.pop(old_key)
KeyError: 'bert.embeddings.LayerNorm.gamma'

@Tongjilibo
Copy link

我也遇到了,你解决了吗

@Tongjilibo
Copy link

我也遇到了,你解决了吗

解决了,修改了了下variable_mapping里面的映射,把gamma和beta修改为weight和bias

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