How to avoid the dreaded torchvision 0.2.2 with conda

I’m trying to set up stable pytorch (1.11) with new CUDA for new GPUs on Ubuntu using conda. The webpage instructions are:

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

But for some reason, sometimes when I run this it works fast and great, and on other machines it doesn’t.
In each case, starting from a brand new py3.10 conda environment. Same latest conda (4.12.0), sometimes it says

Solving environment: failed with initial frozen solve. Retrying with flexible solve.

and after thinking for a while decides it wants to install torchvision-0.2.2. I think that ancient version of torchvision keeps coming up because it was the last pure python one without any extensions so it’s always available even if there are no binaries? But it really doesn’t work well for much of anything and just gets in the way by pretending to meet some requirement when it really doesn’t.

I think this might be a conda issue at its core, but I’m really confused. Any suggestions?

Try to create a new virtual environment and install the conda binaries there as your current env might run into conflicting packages.

Yeah, that should work, right? But as I said, in each case i was starting with a brand new conda environment. So the first things ever installed into that environment are the pytorch libraries. And sometimes it works and sometimes it doesn’t.

Or here’s another strange one:

$ conda create -n pred39a python=3.9
$ conda activate pred39a
$ conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

[...]
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
[...]

The following NEW packages will be INSTALLED:
[...]
  pytorch            pytorch/linux-64::pytorch-1.10.2-py3.9_cuda11.3_cudnn8.2.0_0
  torchaudio         pytorch/linux-64::torchaudio-0.10.2-py39_cu113
  torchvision        pytorch/linux-64::torchvision-0.11.3-py39_cu113

The web page says this should install 1.11.0 but it’s installing 1.10.2. :frowning:

Yes, it should work and also works for me:

conda create -n pred39a python=3.9
conda activate pred39a
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
...
The following packages will be downloaded:
...
    pytorch-1.11.0             |py3.9_cuda11.3_cudnn8.2.0_0        1.02 GB  pytorch
    torchaudio-0.11.0          |       py39_cu113         5.3 MB  pytorch
    torchvision-0.12.0         |       py39_cu113         9.2 MB  pytorch
...
The following NEW packages will be INSTALLED:
...
  pytorch            pytorch/linux-64::pytorch-1.11.0-py3.9_cuda11.3_cudnn8.2.0_0
  pytorch-mutex      pytorch/noarch::pytorch-mutex-1.0-cuda
  torchaudio         pytorch/linux-64::torchaudio-0.11.0-py39_cu113
  torchvision        pytorch/linux-64::torchvision-0.12.0-py39_cu113
...

Did you change anything in the default channel lookup or anything else?

As a workaround (assuming you are still stuck) you could download the conda binary directly and install it from here.

Okay fine. Clearly something’s messed up about my system. I just wish I knew what. I even did a clean install of conda which didn’t help. And the whole reason for putting up with conda’s condaness is that it’s supposed to be reliable if painfully slow and clunky.

Thanks for the help.

Yeah, no idea what’s going on. Do you know if there is any verbose option which could give more information about why conda is failing in your case so that we could compare your outputs?