getalp/Flaubert

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

keloemma opened this issue · 4 comments

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 ?

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 ?

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" ./
yveszq commented

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

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