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 'int_classes' from 'torch._six' #272

Closed
angaio opened this issue Aug 14, 2021 · 2 comments
Closed

cannot import name 'int_classes' from 'torch._six' #272

angaio opened this issue Aug 14, 2021 · 2 comments

Comments

@angaio
Copy link

angaio commented Aug 14, 2021

Hi:
when I run the example on win10,cuda10,the following errors occurs.
Does anyone have the same error?what's problem?

Traceback (most recent call last):
File "run_webcam.py", line 9, in
from pytracking.evaluation import Tracker
File "..\pytracking_init_.py", line 7, in
from pytracking.run_tracker import run_tracker
File "..\pytracking\run_tracker.py", line 9, in
from pytracking.evaluation import get_dataset
File "..\pytracking\evaluation_init_.py", line 1, in
from .data import Sequence
File "..\pytracking\evaluation\data.py", line 3, in
from ltr.data.image_loader import imread_indexed
File "..\ltr\data_init_.py", line 1, in
from .loader import LTRLoader
File "..\ltr\data\loader.py", line 5, in
from torch._six import string_classes, int_classes
ImportError: cannot import name 'int_classes' from 'torch._six'

@tm9161
Copy link

tm9161 commented Aug 14, 2021

In pytorch 1.9 'int_classes variable in torch._six was removed . facebookresearch/TimeSformer#47
I have the same problem and use this code instead.

from torch._six import string_classes
int_classes = (bool, int)

@angaio
Copy link
Author

angaio commented Aug 15, 2021

Ok,Thank you!
I just try to comment the sentence "from torch._six import string_classes, int_classes",It becomes ok!
As below:
import collections
#from torch._six import string_classes, int_classes
from pytracking import TensorDict, TensorList

@angaio angaio closed this as completed Aug 15, 2021
mawanda-jun added a commit to mawanda-jun/Unsupervised-Semantic-Segmentation that referenced this issue Feb 15, 2022
`int_classes` was removed from `torch._six`. So I'm applying a fix (seen here: visionml/pytracking#272 (comment)).
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

2 participants