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 run colab example code #61

Open
mistake0316 opened this issue Sep 15, 2021 · 4 comments
Open

cannot run colab example code #61

mistake0316 opened this issue Sep 15, 2021 · 4 comments

Comments

@mistake0316
Copy link

torch version : 1.9.0+cu102

Error happen while do this import

from torch._six import queue, string_classes
# https://github.com/mit-han-lab/once-for-all/blob/ffbcf6669249156501ceb41bcf1c7ea3665970bd/ofa/utils/my_dataloader/my_data_loader.py#L15

In torch 1.9
It does ot have ""queue"" and "string_classes" in torch._six
https://github.com/pytorch/pytorch/blob/master/torch/_six.py

However, torch version 1.8 has these function
https://github.com/pytorch/pytorch/blob/release/1.8/torch/_six.py

@rappysaha
Copy link

Same here. I installed torch version: 1.8. But still have the same error.

@ameetgohil
Copy link

Modifying pytorch and torchvision pip install commands to use torch 1.8.1 and torchvision 0.9.0 works. It will print an error complaining about torchtext dependency but the notebook will run just fine.
Use:

print('Installing PyTorch and Torchvision...')
! pip install pip install torch==1.8.0 torchvision==0.9.01>/dev/null

@rappysaha
Copy link

rappysaha commented Sep 27, 2021

it works at Colab but print following error as you said.

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. torchtext 0.10.0 requires torch==1.9.0, but you have torch 1.8.0 which is incompatible.

I was trying to run the tutorial in my pc and it works finally with torch 1.8.0 after restarting my VS-code workspace.
image

Thanks for the suggestion.

@Lyken17
Copy link
Collaborator

Lyken17 commented Nov 23, 2021

Thanks for pointing out it. This is brought API breaking changes from PyTorch. Commit 4f6fce3 should fix the issue.

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

4 participants