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 install any version of torchvision newer than 0.2.2 with opencv for python 3.9 and pytorch 1.9.0 #4076

Open
nexplor opened this issue Jun 17, 2021 · 25 comments · Fixed by #4082

Comments

@nexplor
Copy link

nexplor commented Jun 17, 2021

🐛 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:

channels:
  - defaults
  - anaconda
  - pytorch
  - conda-forge
channel_priority: disabled

On the command line:

conda create -n temp python=3.9
conda activate temp
conda install torchvision opencv pytorch=1.9.0

This installs torchvision version 0.2.2.

Replacing the last line with

conda install torchvision=0.10.0 opencv pytorch=1.9.0

produces the error

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package bzip2 conflicts for:
opencv -> pypy3.6[version='>=7.3.3'] -> bzip2[version='1.0.*|>=1.0.6,<2.0a0|>=1.0.8,<2.0a0|>=1.0.6,<1.1.0a0']
torchvision==0.10.0=py39_cu111 -> ffmpeg[version='>=4.2'] -> bzip2[version='>=1.0.8,<2.0a0']

Package jpeg conflicts for:
torchvision==0.10.0=py39_cu111 -> jpeg[version='<=9b']
torchvision==0.10.0=py39_cu111 -> pillow[version='>=5.3.0'] -> jpeg[version='>=9b,<10a|>=9d,<10a|>=9c,<10a']

Package libpng conflicts for:
torchvision==0.10.0=py39_cu111 -> libpng
torchvision==0.10.0=py39_cu111 -> ffmpeg[version='>=4.2'] -> libpng[version='>=1.6.37,<1.7.0a0']

Package python_abi conflicts for:
torchvision==0.10.0=py39_cu111 -> python_abi=3.9[build=*_cp39]
torchvision==0.10.0=py39_cu111 -> pillow[version='>=5.3.0'] -> python_abi[version='3.6|3.6.*|3.7|3.7.*|3.8.*',build='*_cp38|*_pypy36_pp73|*_pypy37_pp73|*_cp36m|*_cp37m']

Package python conflicts for:
torchvision==0.10.0=py39_cu111 -> python[version='>=3.9,<3.10.0a0']
opencv -> py-opencv==4.5.2=py39hef51801_0 -> python[version='3.7.*|3.9.*|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|3.8.*']
opencv -> python[version='2.7.*|3.5.*|3.6.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0|3.4.*']
torchvision==0.10.0=py39_cu111 -> pillow[version='>=5.3.0'] -> python[version='3.9.*|>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0|>=3.5,<3.6.0a0']
python=3.9

Package _libgcc_mutex conflicts for:
opencv -> libgcc-ng[version='>=7.3.0'] -> _libgcc_mutex[version='*|0.1|0.1',build='main|conda_forge']
python=3.9 -> libgcc-ng[version='>=7.5.0'] -> _libgcc_mutex[version='*|0.1|0.1',build='main|conda_forge']

Package tzdata conflicts for:
torchvision==0.10.0=py39_cu111 -> python[version='>=3.9,<3.10.0a0'] -> tzdata
python=3.9 -> tzdataThe following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.33=0
  - torchvision==0.10.0=py39_cu111 -> cudatoolkit[version='>=11.1,<11.2'] -> __glibc[version='>=2.17,<3.0.a0']

Your installed version is: 2.33

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

@nexplor
Copy link
Author

nexplor commented Jun 17, 2021

cc @fmassa @seemethere

@sxh-lsc
Copy link

sxh-lsc commented Jun 17, 2021

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.

@sxh-lsc
Copy link

sxh-lsc commented Jun 17, 2021

pip3 -install torchversion==0.9.0
Could not find a version that satisfies the requirement torchvision==0.9.0(from versions:0.1.6,0.1.7have ,0.1.8,0.1.9,0.2.0,0.2.1,0.2.2,0.2.2,0.2.post2,0.2.2.post3

I have met the BUG 24hours ago,I am building some environments for new machines, and it bothers me a lot.

@sxh-lsc
Copy link

sxh-lsc commented Jun 17, 2021

pip3 -install torchversion==0.9.0
Could not find a version that satisfies the requirement torchvision==0.9.0(from versions:0.1.6,0.1.7have ,0.1.8,0.1.9,0.2.0,0.2.1,0.2.2,0.2.2,0.2.post2,0.2.2.post3

I have met the BUG 24hours ago,I am building some environments for new machines, and it bothers me a lot.
btw I did not in conda.

@NicolasHug
Copy link
Member

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)

@fmassa
Copy link
Member

fmassa commented Jun 17, 2021

For information, you can get unblocked by doing

conda install -c pytorch-test torchvision

if you are working with conda.

we will be fixing the issue soon.

@farleylai
Copy link

It's still the same old issue with jpeg<=9b such that an older version is selected.

@sxh-lsc
Copy link

sxh-lsc commented Jun 17, 2021

It's still the same old issue with jpeg<=9b such that an older version is selected.

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.

@sxh-lsc
Copy link

sxh-lsc commented Jun 17, 2021

For information, you can get unblocked by doing

conda install -c pytorch-test torchvision

if you are working with conda.

we will be fixing the issue soon.

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.

@seemethere
Copy link
Member

It's still the same old issue with jpeg<=9b such that an older version is selected.

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.

Hello! We don't currently provide official packages for Jetson Nano's, if you'd like to install torchvision on your platform I'd suggest building directly from source!

@NicolasHug
Copy link
Member

@nexplor would you mind trying again to check if the error persists? Hopefully #4082 (now merged) will have fixed the issue

@nexplor
Copy link
Author

nexplor commented Jun 22, 2021

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)

@nexplor
Copy link
Author

nexplor commented Jun 22, 2021

To clarify, these aren't possible to install together with opencv. Without opencv, these two versions can be installed together.

@farleylai
Copy link

farleylai commented Jun 22, 2021

The latest torchvision=0.10 requires ffmpeg>=4.2 such that only opencv>=4.2 is eligible and available from conda-forge. However, opencv>=4.2 requires jpge>=9d in conflict with jpeg<=9b required by torchvision=0.10. Why torchvision=0.2.2 is picked is because of loose requirements of python3, pytorch, jpeg versions.

This issue is not done yet for the side effect of pinning the jpeg version:

Looking into libjpeg, there are indeed API changes from 9c to 9d regarding jpeg_mem_dest(...). For example, platform dependent size_t replaces unsigned long in an internal structure type my_mem_dest_ptr. Both pillow and opencv eventually opt for pinning jpeg>=9d since some versions (8.0.1 and 4.3 respectively) and adapt to this potential breaking change. It would be odd if torchvision choose NOT to align with those recent dependent packages.

Besides, there are other potentially critical concerns about pinning jpeg<=9b:

Therefore, the solution is likely for torchvision to adapt to jpeg>=9d.
Then the question is what prevents to do so.

On the other hand, there are other complexities and implications due to the dependencies possibly inconsistent across platforms and channels:

  • Different conda channels may specify different dependencies for a particular pkg version even on the same platform
  • Worse, some up to update dependencies are only available in some non-default channels, implying channel dependencies

Since most dependencies would require conda-forge to provide the necessary packages, a careful consideration to include conda-forge seems quite essential.

Workaround

If torchvision may not support jpeg>=9d soon, the other way around is to use the non-official opencv build that is statically linked to its dependencies (libjpeg, ffmpeg, and etc.) and available as opencv-python or opencv-python-headless.

@init27
Copy link

init27 commented Jul 25, 2021

@farleylai Thanks for workaround suggestion!

I tried installing opencv-python via pip ( pip install opencv-python) and that is causing issues for me, now I'm not able to import torch (No Module found error).

It might be possible that I'm not following your suggestions correctly, could you please elaborate on the workaround:

Steps I followed:

  • Setup system wide CUDA to 11.4 & the equivalent Cudnn packages
  • Installed Pytorch 1.9 from conda
  • Pip installed opencv-python inside the conda env

TIA!

@farleylai
Copy link

farleylai commented Jul 26, 2021

@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'

@init27
Copy link

init27 commented Jul 26, 2021

@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 3.8, if I set the conda env to Python 3.9, everything works nicely (all conda installed as suggested by you), Thanks for the help! :)

@seemethere
Copy link
Member

seemethere commented Aug 9, 2021

Resolved in #4240 (comment)

Going to close this issue since conda installation commands should now work for all python versions without having to use conda-forge

Tried to verify that the opencv issue is resolved by the fix from #4240 (comment), but it sadly still produces a similar error

@seemethere seemethere reopened this Aug 9, 2021
@fmassa
Copy link
Member

fmassa commented Aug 9, 2021

I'm bumping up the priority of this issue as this is a critical problem that should be fixed soon

@fmassa fmassa added the bug label Aug 9, 2021
@fmassa
Copy link
Member

fmassa commented Aug 9, 2021

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).

@tothedistance
Copy link

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.

conda list

# packages in environment at /workdir_test/anaconda3/envs/latest:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main
_openmp_mutex             4.5                       1_gnu
absl-py                   0.13.0           py37h06a4308_0
aiohttp                   3.7.4            py37h27cfd23_1
alsa-lib                  1.2.3                h516909a_0    conda-forge
async-timeout             3.0.1            py37h06a4308_0
attrs                     21.2.0             pyhd3eb1b0_0
blas                      1.0                         mkl
blinker                   1.4              py37h06a4308_0
bottleneck                1.3.2            py37heb32a55_1
brotli                    1.0.9                he6710b0_2
brotlipy                  0.7.0           py37h27cfd23_1003
bzip2                     1.0.8                h7b6447c_0
c-ares                    1.17.1               h27cfd23_0
ca-certificates           2021.5.30            ha878542_0    conda-forge
cachetools                4.2.2              pyhd3eb1b0_0
cairo                     1.16.0               hf32fb01_1
certifi                   2021.5.30        py37h89c1867_0    conda-forge
cffi                      1.14.6           py37h400218f_0
chardet                   3.0.4           py37h06a4308_1003
charset-normalizer        2.0.4              pyhd3eb1b0_0
click                     8.0.1              pyhd3eb1b0_0
coverage                  5.5              py37h27cfd23_2
cryptography              3.4.7            py37hd23ed53_0
cudatoolkit               11.1.1               h6406543_8    conda-forge
cycler                    0.10.0                   py37_0
cython                    0.29.24          py37h295c915_0
dataclasses               0.8                pyh6d0b6a4_7
dbus                      1.13.18              hb2f20db_0
expat                     2.4.1                h2531618_2
ffmpeg                    4.1.3                h167e202_0    conda-forge
fontconfig                2.13.1               h6c09931_0
fonttools                 4.25.0             pyhd3eb1b0_0
freetype                  2.10.4               h5ab3b9f_0
gettext                   0.21.0               hf68c758_0
giflib                    5.2.1                h7b6447c_0
glib                      2.68.3               h9c3ff4c_0    conda-forge
glib-tools                2.68.3               h9c3ff4c_0    conda-forge
gmp                       6.2.1                h2531618_2
gnutls                    3.6.15               he1e5248_0
google-auth               1.33.0             pyhd3eb1b0_0
google-auth-oauthlib      0.4.1                      py_2
graphite2                 1.3.14               h23475e2_0
grpcio                    1.36.1           py37h2157cd5_1
gst-plugins-base          1.18.4               hf529b03_2    conda-forge
gstreamer                 1.18.4               h76c114f_2    conda-forge
harfbuzz                  2.8.2                h83ec7ef_0    conda-forge
hdf5                      1.10.5          nompi_h3c11f04_1104    conda-forge
icu                       68.1                 h2531618_0
idna                      3.2                pyhd3eb1b0_0
importlib-metadata        4.8.1            py37h06a4308_0
intel-openmp              2021.3.0          h06a4308_3350
jasper                    1.900.1              hd497a04_4
jpeg                      9d                   h7f8727e_0
kiwisolver                1.3.1            py37h2531618_0
krb5                      1.19.2               hac12032_0
lame                      3.100                h7b6447c_0
lcms2                     2.12                 h3be6417_0
ld_impl_linux-64          2.35.1               h7274673_9
libblas                   3.9.0            11_linux64_mkl    conda-forge
libcblas                  3.9.0            11_linux64_mkl    conda-forge
libclang                  11.1.0          default_ha53f305_1    conda-forge
libedit                   3.1.20210714         h7f8727e_0
libevent                  2.1.10               hcdb4288_3    conda-forge
libffi                    3.3                  he6710b0_2
libgcc-ng                 9.3.0               h5101ec6_17
libgfortran-ng            7.5.0               ha8ba4b0_17
libgfortran4              7.5.0               ha8ba4b0_17
libglib                   2.68.3               h3e27bee_0    conda-forge
libgomp                   9.3.0               h5101ec6_17
libiconv                  1.16                 h516909a_0    conda-forge
libidn2                   2.3.2                h7f8727e_0
liblapack                 3.9.0            11_linux64_mkl    conda-forge
liblapacke                3.9.0            11_linux64_mkl    conda-forge
libllvm11                 11.1.0               h3826bc1_0
libogg                    1.3.5                h27cfd23_1
libopencv                 4.1.2                    py37_2    conda-forge
libopus                   1.3.1                h7b6447c_0
libpng                    1.6.37               hbc83047_0
libpq                     13.3                 hd57d9b9_0    conda-forge
libprotobuf               3.17.2               h4ff587b_1
libstdcxx-ng              9.3.0               hd4cf53a_17
libtasn1                  4.16.0               h27cfd23_0
libtiff                   4.1.0                h2733197_1
libunistring              0.9.10               h27cfd23_0
libuuid                   1.0.3                h1bed415_2
libuv                     1.42.0               h7f98852_0    conda-forge
libvorbis                 1.3.7                h7b6447c_0
libwebp                   1.0.2                h56121f0_5    conda-forge
libxcb                    1.14                 h7b6447c_0
libxkbcommon              1.0.3                he3ba5ed_0    conda-forge
libxml2                   2.9.12               h72842e0_0    conda-forge
lz4-c                     1.9.3                h295c915_1
markdown                  3.3.4            py37h06a4308_0
matplotlib                3.4.2            py37h06a4308_0
matplotlib-base           3.4.2            py37hab158f2_0
mkl                       2021.3.0           h06a4308_520
mkl-service               2.4.0            py37h7f8727e_0
mkl_fft                   1.3.0            py37h42c9631_2
mkl_random                1.2.2            py37h51133e4_0
multidict                 5.1.0            py37h27cfd23_2
munkres                   1.1.4                      py_0
mysql-common              8.0.25               ha770c72_0    conda-forge
mysql-libs                8.0.25               h935591d_0    conda-forge
ncurses                   6.2                  he6710b0_1
nettle                    3.7.3                hbbd107a_1
ninja                     1.10.2               h4bd325d_0    conda-forge
nspr                      4.30                 h9c3ff4c_0    conda-forge
nss                       3.67                 hb5efdd6_0    conda-forge
numexpr                   2.7.3            py37h22e1b3c_1
numpy                     1.20.3           py37hf144106_0
numpy-base                1.20.3           py37h74d4b33_0
oauthlib                  3.1.1              pyhd3eb1b0_0
olefile                   0.46                     py37_0
opencv                    4.1.2                    py37_2    conda-forge
opencv-python             4.5.3.56                 pypi_0    pypi
openh264                  1.8.0                hd408876_0
openjpeg                  2.4.0                h3ad879b_0
openssl                   1.1.1l               h7f8727e_0
pandas                    1.3.2            py37h8c16a72_0
pcre                      8.45                 h295c915_0
pillow                    8.3.1            py37h2c7a002_0
pip                       21.2.2           py37h06a4308_0
pixman                    0.40.0               h7f8727e_0
protobuf                  3.17.2           py37h295c915_0
py-opencv                 4.1.2            py37h5ca1d4c_2    conda-forge
pyasn1                    0.4.8              pyhd3eb1b0_0
pyasn1-modules            0.2.8                      py_0
pycparser                 2.20                       py_2
pyjwt                     2.1.0            py37h06a4308_0
pyopenssl                 20.0.1             pyhd3eb1b0_1
pyparsing                 2.4.7              pyhd3eb1b0_0
pyqt                      5.12.3           py37h89c1867_7    conda-forge
pyqt-impl                 5.12.3           py37he336c9b_7    conda-forge
pyqt5-sip                 4.19.18          py37hcd2ae1e_7    conda-forge
pyqtchart                 5.12             py37he336c9b_7    conda-forge
pyqtwebengine             5.12.1           py37he336c9b_7    conda-forge
pysocks                   1.7.1                    py37_1
python                    3.7.11               h12debd9_0
python-dateutil           2.8.2              pyhd3eb1b0_0
python_abi                3.7                     2_cp37m    conda-forge
pytorch                   1.9.1           py3.7_cuda11.1_cudnn8.0.5_0    pytorch
pytz                      2021.1             pyhd3eb1b0_0
pyyaml                    5.4.1            py37h27cfd23_1
qt                        5.12.9               hda022c4_4    conda-forge
readline                  8.1                  h27cfd23_0
requests                  2.26.0             pyhd3eb1b0_0
requests-oauthlib         1.3.0                      py_0
rsa                       4.7.2              pyhd3eb1b0_1
scipy                     1.7.1            py37h292c36d_2
seaborn                   0.11.2             pyhd3eb1b0_0
setuptools                58.0.4           py37h06a4308_0
six                       1.16.0             pyhd3eb1b0_0
sqlite                    3.36.0               hc218d9a_0
tensorboard               2.6.0                      py_0
tensorboard-data-server   0.6.1                    pypi_0    pypi
tensorboard-plugin-wit    1.6.0                      py_0
tk                        8.6.10               hbc83047_0
torchaudio                0.9.1                      py37    pytorch
torchvision               0.10.1                   pypi_0    pypi
tornado                   6.1              py37h27cfd23_0
tqdm                      4.62.2             pyhd3eb1b0_1
typing-extensions         3.10.0.2             hd3eb1b0_0
typing_extensions         3.10.0.2           pyh06a4308_0
urllib3                   1.26.6             pyhd3eb1b0_1
werkzeug                  2.0.1              pyhd3eb1b0_0
wheel                     0.37.0             pyhd3eb1b0_1
x264                      1!152.20180806       h7b6447c_0
xz                        5.2.5                h7b6447c_0
yaml                      0.2.5                h7b6447c_0
yarl                      1.6.3            py37h27cfd23_0
zipp                      3.5.0              pyhd3eb1b0_0
zlib                      1.2.11               h7b6447c_3
zstd                      1.4.9                haebb681_0

python output

(latest) user@host:~$ python3 -c "import torchvision; print(torchvision.__path__); pri
nt(torchvision.__version__)"
['/workdir_test/anaconda3/envs/latest/lib/python3.7/site-packages/torchvision']
0.2.2

@kylevedder
Copy link

kylevedder commented Dec 2, 2021

This fix impacted PyTorch 1.10, but not earlier versions. For those who want a work-around for earlier versions, e.g. opencv 3 and pytorch 1.8.1, this worked for me:

conda install pip python=3.8 pytorch::pytorch=1.8.1 cudatoolkit=11.1 cudatoolkit-dev=11.1 opencv=3.4.9 -c pytorch -c nvidia -c anaconda -c conda-forge -c defaults
# Manually specify all the requirements for pytorch except jpeg pegged.
# These requirements were found via `conda search --info torchvision=0.9 -c pytorch` and
# then matching the build against the python version (3.8) and CUDA version (11.1)
conda install ffmpeg>=4.2 libpng numpy >=1.11 pillow >=4.1.1
# Pro gamer move: force install without dependency checking via pip. conda 
# will *not* let you force install despite conflicts (--no-deps and --force don't work), see
# https://github.com/conda/conda/issues/2980
pip install torchvision==0.9.1 --no-deps

If you want a different version of PyTorch this should work, but make sure you update the torchvision version to correspond to the new pytorch version and double check the dependency versions.
NB: be very careful that these installs are not later disrupted by other packages.

@mxahan
Copy link

mxahan commented Feb 16, 2022

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.

@init27
Copy link

init27 commented Feb 16, 2022

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

@Sieboldianus
Copy link

Sieboldianus commented Mar 8, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.