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

cannot import name 'container_abcs' from 'torch._six' #1048

Closed
ShoufaChen opened this issue Feb 9, 2021 · 2 comments · Fixed by #1049
Closed

cannot import name 'container_abcs' from 'torch._six' #1048

ShoufaChen opened this issue Feb 9, 2021 · 2 comments · Fixed by #1049

Comments

@ShoufaChen
Copy link
Contributor

>>> from apex import amp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/mnt/lustre/chenshoufa/anaconda3/envs/pytorch18/lib/python3.8/site-packages/apex/__init__.py", line 8, in <module>
    from . import amp
  File "/mnt/lustre/chenshoufa/anaconda3/envs/pytorch18/lib/python3.8/site-packages/apex/amp/__init__.py", line 1, in <module>
    from .amp import init, half_function, float_function, promote_function,\
  File "/mnt/lustre/chenshoufa/anaconda3/envs/pytorch18/lib/python3.8/site-packages/apex/amp/amp.py", line 1, in <module>
    from . import compat, rnn_compat, utils, wrap
  File "/mnt/lustre/chenshoufa/anaconda3/envs/pytorch18/lib/python3.8/site-packages/apex/amp/rnn_compat.py", line 1, in <module>
    from . import utils, wrap
  File "/mnt/lustre/chenshoufa/anaconda3/envs/pytorch18/lib/python3.8/site-packages/apex/amp/wrap.py", line 3, in <module>
    from ._amp_state import _amp_state
  File "/mnt/lustre/chenshoufa/anaconda3/envs/pytorch18/lib/python3.8/site-packages/apex/amp/_amp_state.py", line 14, in <module>
    from torch._six import container_abcs
ImportError: cannot import name 'container_abcs' from 'torch._six' (/mnt/lustre/chenshoufa/anaconda3/envs/pytorch18/lib/python3.8/site-packages/torch/_six.py)
@kawseribn
Copy link

import collections.abc as container_abcs this might solve your problem

@anonymousleo
Copy link

i solved this error by following this link

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

Successfully merging a pull request may close this issue.

3 participants