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

issue of [cannot import name 'TransformerEncoderLayer' from 'fairseq.modules'] #36

Open
George-WG-Cao opened this issue Sep 19, 2024 · 1 comment

Comments

@George-WG-Cao
Copy link

Hello.
When I tesing the code with medmnist with 'train_medmnist.sh', I got the following errors.

File "/BiomedGPT/fairseq/fairseq/models/text_to_speech/init.py", line 7, in
from .tts_transformer import * # noqa
from .tts_transformer import * # noqa File "
/BiomedGPT/fairseq/fairseq/models/text_to_speech/tts_transformer.py", line 15, in

File "/BiomedGPT/fairseq/fairseq/models/text_to_speech/tts_transformer.py", line 15, in
from fairseq.modules import (
from fairseq.modules import (ImportError
: cannot import name 'TransformerEncoderLayer' from 'fairseq.modules' (
/BiomedGPT/fairseq/fairseq/modules/init.py)ImportError
: cannot import name 'TransformerEncoderLayer' from 'fairseq.modules' (~/BiomedGPT/fairseq/fairseq/modules/init.py)
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 1846243) of binary: ~/anaconda3/envs/biomedgpt/bin/python3

please tell me how to tackle this proglem.
Thanks.

@taokz
Copy link
Owner

taokz commented Sep 19, 2024

Please try

python -m pip install pip==21.2.4
pip uninstall fairseq
pip install -r requirements.txt

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