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: module 'apex' has no attribute 'amp' #13

Closed
keloemma opened this issue Feb 12, 2020 · 4 comments
Closed

AttributeError: module 'apex' has no attribute 'amp' #13

keloemma opened this issue Feb 12, 2020 · 4 comments

Comments

@keloemma
Copy link

keloemma commented Feb 12, 2020

I am getting this error when traning Flaubert.

INFO - 02/12/20 19:50:47 - 0:00:11 - Number of parameters (model): 92501715
INFO - 02/12/20 19:50:51 - 0:00:15 - Before setting SingleTrainer variables.
INFO - 02/12/20 19:50:51 - 0:00:15 - After setting SingleTrainer variables.
INFO - 02/12/20 19:50:52 - 0:00:15 - Found 0 memories.
INFO - 02/12/20 19:50:52 - 0:00:16 - Found 12 FFN.
INFO - 02/12/20 19:50:53 - 0:00:16 - Found 197 parameters in model.
INFO - 02/12/20 19:50:53 - 0:00:17 - Optimizers: model
Traceback (most recent call last):
File "train.py", line 391, in
main(params)
File "train.py", line 266, in main
trainer = SingleTrainer(model, data, params)
File "/home/ge/ke/eXP/Flaubert/xlm/trainer.py", line 857, in init
super().init(data, params)
File "/home/ge/ke/eXP/Flaubert/xlm/trainer.py", line 81, in init
self.init_amp()
File "/home/gekelodjoe/eXP/Flaubert/xlm/trainer.py", line 205, in init_amp
models, optimizers = apex.amp.initialize(
AttributeError: module 'apex' has no attribute 'amp'

Do you have any idea how can I solve it ?

@keloemma
Copy link
Author

keloemma commented Feb 12, 2020

Now after reinstalling it : I get this error

FAISS library was not found.
FAISS not available. Switching to standard nearest neighbors search implementation.
Traceback (most recent call last):
File "train.py", line 23, in
from xlm.trainer import SingleTrainer, EncDecTrainer
File "/home/gekelodjoe/eXP/Flaubert/xlm/trainer.py", line 21, in
import apex
File "/home/ge/kelodjoe/anaconda3/lib/python3.7/site-packages/apex/init.py", line 6, in
from . import parallel
ImportError: cannot import name 'parallel' from 'apex' (/home/getalp/ke/anaconda3/lib/python3.7/site-packages/apex/init.py)

Now I am having this error ? Should I reinstall apex from github ?

@formiel
Copy link
Contributor

formiel commented Feb 13, 2020

Hi @keloemma,

Can you try reinstalling apex with CUDA and C++ extensions like this?

$ git clone https://github.com/NVIDIA/apex
$ cd apex
$ pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./

@formiel formiel closed this as completed Mar 22, 2020
@yveszq
Copy link

yveszq commented Aug 22, 2023

Hi @keloemma, do you have solved this problem? If yes, can you tell me how to solve it? Best wishes to you!

@ArunMaramraj
Copy link

@formiel the commands you suggested don't resolve the problem

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

4 participants