Modules missing after installing Pytorch 1.7.1

JamesDickens: <p>I just updated from pytorch 1.7.0 to 1.7.1 using anaconda  and I seem to no longer be able to see</p>
<p>torchvision.models.detection</p>
<p>or torchvision.ops</p>
<p>How do I access these modules? Maybe my install was bad?</p>
<p>How can I revert back to Pytorch 1.7.0</p>

ptrblck: <p>I cannot reproduce this issue and am able to import the mentioned modules:</p>
<pre><code class="lang-python">&gt;&gt;&gt; import torch
&gt;&gt;&gt; import torchvision
&gt;&gt;&gt; torch.__version__
'1.7.1'
&gt;&gt;&gt; torchvision.__version__
'0.8.2'
&gt;&gt;&gt; import torchvision.models as models
&gt;&gt;&gt; models.detection
&lt;module 'torchvision.models.detection' from '.../anaconda3/envs/pytorch_171/lib/python3.8/site-packages/torchvision/models/detection/__init__.py'&gt;
&gt;&gt;&gt; torchvision.ops
&lt;module 'torchvision.ops' from '.../anaconda3/envs/pytorch_171/lib/python3.8/site-packages/torchvision/ops/__init__.py'&gt;
</code></pre>
<p>Are you sure you’ve installed the latest PyTorch and <code>torchvision</code> releases?</p>

JamesDickens: <p>Here is my revision history in Anaconda. Rev 10 is for 1.7, and Rev 11 is for 1.7.1</p>
<blockquote>
<p>2020-12-01 15:15:19  (rev 10)<br>
cudatoolkit  {11.0.221 (defaults/win-64) → 11.0.3 (conda-forge/win-64)}<br>
pytorch  {1.8.0.dev20201021 (pytorch-nightly/win-64) → 1.7.0 (pytorch/win-64)}<br>
torchvision  {0.8.0.dev20201021 (pytorch-nightly/win-64) → 0.8.1 (pytorch/win-64)}<br>
+torchaudio-0.7.0 (pytorch/win-64)</p>
<p>2020-12-10 22:57:52  (rev 11)<br>
ca-certificates  {2020.11.8 (conda-forge/win-64) → 2020.12.5 (conda-forge/win-64)}<br>
certifi  {2020.11.8 (conda-forge/win-64) → 2020.12.5 (conda-forge/win-64)}<br>
pytorch  {1.7.0 (pytorch/win-64) → 1.7.1 (pytorch/win-64)}<br>
torchaudio  {0.7.0 (pytorch/win-64) → 0.7.2 (pytorch/win-64)}<br>
torchvision  {0.8.1 (pytorch/win-64) → 0.2.2 (pytorch/noarch)}<br>
+six-1.15.0 (conda-forge/noarch)</p>
</blockquote>
<p>For whatever reason I see “noarch” in regards to torchvision. I used the command:<br>
<code>conda install pytorch torchvision torchaudio cudatoolkit=11.0 -c pytorch</code></p>
<p>It’s worth mentioning I’ve been modifying the code a little bit in these modules mentioned in the original question, incase that has something to do with it.</p>
<p>As a followup, since I have an RTX 3080 GPU and am using 16 bit precision with torch.cuda.amp.autocast(), is it worth it to upgrade to 1.7.1. I read something about it being faster. Anyway thanks for the help</p>

ptrblck: <p>Based on the output it seems your <code>torchvision</code> version was downgraded to <code>0.2.2</code>:</p>
<pre><code class="lang-auto">torchvision {0.8.1 (pytorch/win-64) -&gt; 0.2.2 (pytorch/noarch)}
</code></pre>
<p>and I’m unsure why this would happen. Could you create a new virtual environment and reinstall the latest lib versions?</p>
<aside class="quote no-group" data-username="JamesDickens" data-post="3" data-topic="105825">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/jamesdickens/48/45317_2.png" class="avatar"> JamesDickens:</div>
<blockquote>
<p>is it worth it to upgrade to 1.7.1.</p>
</blockquote>
</aside>
<p>I would generally recommend to update to the latest release for the best support.<br>
Also, the <code>1.7.1</code> binaries ship with cudnn 8.0.5, which should improve the performance compared to 8.0.3.</p>

JamesDickens: <p>Made a new conda environment and everything worked. I suspect it’s because I modified code from those modules but maybe it’s another reason. Oh well.</p>