When I import apex after the installation (finished with success) I get this error:
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import apex
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "apex/__init__.py", line 2, in <module>
from . import amp
File "apex/amp/__init__.py", line 1, in <module>
from .amp import init, half_function, float_function, promote_function,\
File "apex/amp/amp.py", line 1, in <module>
from . import compat, rnn_compat, utils, wrap
File "apex/amp/rnn_compat.py", line 1, in <module>
from . import utils, wrap
File "apex/amp/wrap.py", line 4, in <module>
from . import rnn_compat
ImportError: cannot import name rnn_compat
torch version 1.0.0.dev20190322
Python 2.7.15rc1
cuda 10
Are you using apex as your working directory?
If so, could you change the wdir and try to import apex again?
this is not the problem, but /homedir/.local/lib/python2.7/site-packages/apex/amp/rnn_compat.py is there
I could reproduce this error using Python 2.7.15 and as stated in the docs, we only support Python >=3.
Would it be possible for you to use a newer Python version?
oh right, it might be this the problem.
thanks I'll check
Did updating python fix the issue? Can we close this?
Please reopen if the problem continues with python 3+.
The solution for me is
import rnn_compat
(instead of from . import rnn_compat)
Most helpful comment
The solution for me is
import rnn_compat
(instead of from . import rnn_compat)