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

AttributeError: can't set attribute #9

Open
littlehacker26 opened this issue Nov 3, 2020 · 1 comment
Open

AttributeError: can't set attribute #9

littlehacker26 opened this issue Nov 3, 2020 · 1 comment

Comments

@littlehacker26
Copy link

I find the magicmodule can's process RNNBased Module,
such as :meta_model = MagicModule(nn.RNN(10,10))
The errors "AttributeError: can't set attribute " will appear, could you help me find out what's wrong with it?

@tanyuqian
Copy link
Owner

A simple way to fix it is to copy the missing function you need from nn.RNN into the MagicModule. For example, in our code, "transpose_for_scores()" is a copy from the original code of pytorch_pretrained_bert.

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