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

ImportError: cannot import name 'TransformerEncoderLayer #1236

Closed
JoyHuYY1412 opened this issue Oct 22, 2019 · 10 comments
Closed

ImportError: cannot import name 'TransformerEncoderLayer #1236

JoyHuYY1412 opened this issue Oct 22, 2019 · 10 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@JoyHuYY1412
Copy link

My pytorch is 1.1.0 and python is 3.6.8.

@JoyHuYY1412 JoyHuYY1412 added the question Further information is requested label Oct 22, 2019
@JoyHuYY1412
Copy link
Author

I switch the version to 0.4.3 and the question is not reported.

@NDTanja
Copy link

NDTanja commented Oct 22, 2019

I also get the ImportError with flair 0.4.4. With flair 0.4.3 everything works fine.

@yosipk
Copy link
Collaborator

yosipk commented Oct 22, 2019

Could you, please, upgrade PyTorch to 1.2.0 (pip install torch==1.2.0) since AFAIK that's the first version that has torch.nn.TransformerEncoderLayer. If that works, we'll just have to bump the PyTorch version in requirements.txt.

@NDTanja
Copy link

NDTanja commented Oct 22, 2019

I updated PyTorch to the latest version (1.3.0) but unfortunately, I still get the ImportError. I am using Python 3.8.0

@robertodias
Copy link

robertodias commented Oct 23, 2019

Same thing to me, I am using AWS Sagemaker notebooks.
this seams to be a flair 0.4.4 issue, because it all work fine when we force it back to 0.4.3

!pip install flair==0.4.3

@alanakbik
Copy link
Collaborator

@robertodias have you tried setting torch to 1.2.0?

@99991
Copy link

99991 commented Dec 13, 2019

Curiously, I had the same issue with torch==1.2.0 and flair==0.4.4 but it works with torch==1.3.0.

@cooleel
Copy link

cooleel commented Dec 31, 2019

torch==1.2.0 and flair==0.4.4 work for me.

@stale
Copy link

stale bot commented Apr 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 29, 2020
@stale stale bot closed this as completed May 6, 2020
@LLh-lihan
Copy link

same problem here. Pytorch 1.10.2 and python 3.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

8 participants