How to avoid the dreaded torchvision 0.2.2 with conda

robotrapta: <p>I’m trying to set up stable pytorch (1.11) with new CUDA for new GPUs on Ubuntu using conda.  The webpage instructions are:</p>
<pre><code class="lang-auto">conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
</code></pre>
<p>But for some reason, sometimes when I run this it works fast and great, and on other machines it doesn’t.<br>
In each case, starting from a brand new py3.10 conda environment.  Same latest conda (4.12.0), sometimes it says</p>
<pre><code class="lang-auto">Solving environment: failed with initial frozen solve. Retrying with flexible solve.
</code></pre>
<p>and after thinking for a while decides it wants to install <code>torchvision-0.2.2</code>.  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.</p>
<p>I think this might be a conda issue at its core, but I’m really confused.  Any suggestions?</p>

ptrblck: <p>Try to create a new virtual environment and install the conda binaries there as your current env might run into conflicting packages.</p>

robotrapta: <p>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.</p>

robotrapta: <p>Or here’s another strange one:</p>
<pre><code class="lang-auto">$ 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
</code></pre>
<p>The web page says this should install <code>1.11.0</code> but it’s installing <code>1.10.2</code>.  <img src="https://discuss.pytorch.org/images/emoji/apple/frowning.png?v=12" title=":frowning:" class="emoji" alt=":frowning:" loading="lazy" width="20" height="20"></p>

ptrblck: <p>Yes, it should work and also works for me:</p>
<pre><code class="lang-python">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
...
</code></pre>
<p>Did you change anything in the default channel lookup or anything else?</p>
<p>As a workaround (assuming you are still stuck) you could download the conda binary directly and install it from <a href="https://anaconda.org/pytorch/pytorch/files">here</a>.</p>

robotrapta: <p>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.</p>
<p>Thanks for the help.</p>

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