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

JIT problem with torchvision 0.5 #694

Closed
Borda opened this issue Jan 16, 2020 · 10 comments · Fixed by #797
Closed

JIT problem with torchvision 0.5 #694

Borda opened this issue Jan 16, 2020 · 10 comments · Fixed by #797
Labels
bug Something isn't working help wanted Open to be worked on

Comments

@Borda
Copy link
Member

Borda commented Jan 16, 2020

🐛 Bug

There are some JIT problems with newly released torchvision 0.5
in #687 we freeze version to <0.5 but in future, we want to support all torchvisions
Maybe it is just a temporal bug in torchvision and they will handle it...

To Reproduce

#687 (comment)

Environment

https://app.circleci.com/jobs/github/Borda/pytorch-lightning/839

@9dogs
Copy link

9dogs commented Feb 5, 2020

Based on pytorch/vision#1383 (comment) torchvision now requires "recent enough" version of PyTorch. All tests are green with pytorch==1.4.0 and torchvision==0.5.0.
The problem is when pytorch==1.3.0 is installed, pip install torchvision installs torchvision==0.5.0 which is incompatible. Ah, I love dependency issues...

@Borda
Copy link
Member Author

Borda commented Feb 5, 2020

Then the problem is torchvision, it shall enforce torch >= 1.4.0

@9dogs
Copy link

9dogs commented Feb 5, 2020

But it does (starting from 0.4.0):

# pkginfo -f requires_dist torchvision-0.5.0+cpu-cp37-cp37m-linux_x86_64.whl
requires_dist: ['numpy', 'six', 'torch (==1.4.0)', 'pillow (>=4.1.1)', "scipy ; extra == 'scipy'"]
# pkginfo -f requires_dist torchvision-0.4.2+cpu-cp37-cp37m-linux_x86_64.whl
requires_dist: ['numpy', 'six', 'torch (==1.3.1)', 'pillow (>=4.1.1)', "scipy ; extra == 'scipy'"]
# pkginfo -f requires_dist torchvision-0.4.1+cpu-cp37-cp37m-linux_x86_64.whl
requires_dist: ['numpy', 'six', 'torch (==1.3.0)', 'pillow (>=4.1.1)', "scipy ; extra == 'scipy'"]
# pkginfo -f requires_dist torchvision-0.4.0+cu92-cp37-cp37m-manylinux1_x86_64.whl
requires_dist: ['numpy', 'six', 'torch (==1.2.0)', 'pillow (>=4.1.1)', "scipy ; extra == 'scipy'"]

My problem is I cannot freeze dependencies via pip-tools with torch==1.4.0 since pytorch-lightning limits torchvision version.
Dirty solution is to manipulate torch version through torchvision, i.e. omit torch dependency in requirements.txt completely and set torchvision>=0.4.0.

@neggert
Copy link
Contributor

neggert commented Feb 7, 2020

Do we need the torchvision dependency at all? IIRC it is only used for tests and examples.

@williamFalcon
Copy link
Contributor

  1. idk why we would limit the version
  2. not needed. We do need to add to the examples that people need to have torchvision and torch installed.

@Borda
Copy link
Member Author

Borda commented Feb 7, 2020

we are using MNIST dataset in tests from torchvision.datasets import MNIST and transforms from torchvision import transforms

@williamFalcon
Copy link
Contributor

so add torchvision to the tests requirements

@Borda
Copy link
Member Author

Borda commented Feb 7, 2020

but it is in package pytorch_lightning.testing.base_model so we would need to move it also out of the package or make own MNIT...

@kartikJ-9
Copy link

I have torch version 0.4.1, and torchvision->inception.py says that there is no module named call Optional in torch.jit.annotations....I want to use torch version 0.4.1 because I want to use it along with cuda 9.2 for my program. And as per my understanding, torchvision requires torch 1.4. How do I solve this dependency problem?

@Borda
Copy link
Member Author

Borda commented Apr 2, 2020

are you talking about torch==0.4.1 or torchvision=0.4.1 this is not related to lightning, you shall ask at torch/vision

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Open to be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants