-
Notifications
You must be signed in to change notification settings - Fork 7k
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 install any version of torchvision newer than 0.2.2 with opencv for python 3.9 and pytorch 1.9.0 #4076
Comments
GOD I HAVE the same BUG in linux_cuda10.2 Pytorch 1.8. When I pip install the torchvision,the highest version is 0.22,I also use pip3 -i to change the orgin ,fail too. |
I have met the BUG 24hours ago,I am building some environments for new machines, and it bothers me a lot. |
|
Thanks for the report, we're working on it. It doesn't seem to be related to opencv though, or at least it also happens without opencv on conda: #4071 (comment) |
For information, you can get unblocked by doing
if you are working with conda. we will be fixing the issue soon. |
It's still the same old issue with |
My os is completely new. I just installed torch. However , I am using jetson nano which contains opencv4.1.1(not python-opencv).I did not have jpeg in my pip list. |
TKU any way,but i am not working with conda, just python-pip in linux python3.6. And I've noticed when I upgrade pip, the version information added 0.9.1 and 0.10.0, still did not 0.9.0 or the others. |
Hello! We don't currently provide official packages for Jetson Nano's, if you'd like to install |
I checked again, and the issue still persists. I can install torchvision 0.9.0 with pytorch 1.8.0, but no newer combination of versions (torchvision 0.10.0 with pytorch 1.9.0 still throws an error) |
To clarify, these aren't possible to install together with opencv. Without opencv, these two versions can be installed together. |
The latest This issue is not done yet for the side effect of pinning the jpeg version:
Looking into Besides, there are other potentially critical concerns about pinning Therefore, the solution is likely for On the other hand, there are other complexities and implications due to the dependencies possibly inconsistent across platforms and channels:
Since most dependencies would require WorkaroundIf |
@farleylai Thanks for workaround suggestion! I tried installing It might be possible that I'm not following your suggestions correctly, could you please elaborate on the workaround: Steps I followed:
TIA! |
@init27, unfortunately, I cannot reproduce the issue you had. In general, it is not recommended to install packages through pip in a conda env. Better to use its conda distribution or simply make one. Also, therer should not be necessary to set up system wide CUDA or CuDNN for pytorch since both are available through conda. (base) $ mamba create -n test39 python=3.9
(base) $ conda activate test39
(test39) $ mamba install pytorch=1.9 numpy
...
Finished libuv (00m:00s) 1 MB 1 MB/s
Finished cudatoolkit (04m:27s) 1 GB 16 MB/s
Downloading [====================================================================================] (04m:27s)
Preparing transaction: done
Verifying transaction: done
Executing transaction: / By downloading and using the CUDA Toolkit conda packages, you accept the terms and conditions of the CUDA End User License Agreement (EULA): https://docs.nvidia.com/cuda/eula/index.html
done
(test39) $ pip install opencv-python
Collecting opencv-python
Downloading opencv_python-4.5.3.56-cp39-cp39-manylinux2014_x86_64.whl (49.9 MB)
|████████████████████████████████| 49.9 MB 15.9 MB/s
Requirement already satisfied: numpy>=1.19.3 in /home/ml/farleylai/miniconda3/envs/test39/lib/python3.9/site-packages (from opencv-python) (1.21.1)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.5.3.56
(test39) farleylai@eigen01:~/local/projects$ python
Python 3.9.6 | packaged by conda-forge | (default, Jul 11 2021, 03:39:48)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.9.0'
>>> import cv2
>>> cv2.__version__
'4.5.3' |
@farleylai Thanks for helping investigate and the pointers. I've never looked at creating a conda distribution, but I will dig into it. I was able to find my fault-I was using Python |
Tried to verify that the |
I'm bumping up the priority of this issue as this is a critical problem that should be fixed soon |
One current potential workaround is to remove the dependency on ffmpeg to torchvision. It wasn't supposed to be an install dependency of torchvision to begin with (it's an optional dependency for those wanting to use video, and we don't ship binaries compiled with ffmpeg). |
I seem to encouter the similar problem. I somehow managed to install torchvision=0.10. But when i check it in python interpreter, it shows 0.2.2.
|
This fix impacted PyTorch 1.10, but not earlier versions. For those who want a work-around for earlier versions, e.g.
If you want a different version of PyTorch this should work, but make sure you update the |
Recently, I faced a similar annoying issue (Anaconda, Ubuntu 20.04). I fixed the issue by getting 'ffmpeg' version 4.2.2 (please check the version by "ffmpeg -version"). Further, I had to specify the version during conda installation of Pytorch, and torchvision. |
After much fighting with my scares of learning Docker, I have started using the NGC images-I would highly recommend the same for making installations easier compared to conda |
I had the same issue - I needed pytorch 1.7.1, but torchvision 0.2.2 was installed: conda create -n testenv -c conda-forge python=3.6
conda activate testenv
conda install --yes -c pytorch pytorch=1.7.1 torchvision Check the corresponding version of torchvision here, for pytorch 1.7.1, this is 0.8.2, and then install with fixed: conda create -n testenv -c conda-forge python=3.6
conda activate testenv
conda config --env --set channel_priority strict
conda install --yes -c pytorch -c conda-forge pytorch=1.7.1 torchvision=0.8.2 It still installed a lower version, but not too bad: conda activate testenv
python -c "import torchvision;print(torchvision.__version__);"
> 0.8.0a0 |
🐛 Bug
Issue #3207 has cropped up again for pytorch 1.9.0
Cannot install any version of torchvision newer than 0.2.2 with opencv for python 3.9
To Reproduce
Contents of
~/.condarc
:On the command line:
This installs torchvision version 0.2.2.
Replacing the last line with
produces the error
Expected behavior
Torchvision version 0.10.0 should be selected for installation.
If version is explicitly specified, packages should get installed without error.
Environment
OS: Ubuntu 20.10 (x86_64)
GCC version: (Ubuntu 10.2.0-13ubuntu1) 10.2.0
Clang version: 11.0.0-2
CMake version: version 3.16.3
Python version: 3.9 (64-bit runtime)
GPU models and configuration: GPU 0: GeForce 930MX
Nvidia driver version: 460.80
The text was updated successfully, but these errors were encountered: