ImportError: cannot import name rnn_compat
See original GitHub issueWhen 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
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >ImportError: cannot import name rnn_compat #781 - GitHub
Questions and Help when i run 'python webcam.py --min-image-size 300 MODEL.DEVICE cpu ', it shows: Traceback (most recent call last): File ...
Read more >What can I do about "ImportError: Cannot import name X" or ...
You have circular dependent imports. physics.py is imported from entity before class Ent is defined and physics tries to import entity that is...
Read more >How to Fix : “ImportError: Cannot import name X” in Python?
You can solve the “ ImportError : Cannot import name X” Error by resolving the circular dependencies. You can do that either by...
Read more >Why Python Package Manager gives error as "ImportError
How to resolve the following error message when running any pip3 commands ... ImportError: cannot import name 'InvalidSchemeCombination' ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The solution for me is import rnn_compat
(instead of from . import rnn_compat)
Please reopen if the problem continues with python 3+.