Problem deinstalling and installing properly Pytorch

username: Valery_Andreev
cooked: <p>Hi there,<br>
quite new to machine learning and a junior in coding (in whole different sphere up until now) so sorry for the dumb question.</p>
<p>Trying to run Peter Baylies generator as well as the StyleGan2-ADA-pytorch version on an Ubuntu 18.04. I use both Conda and Pip to install the required dependencies however I’ve had particular problem with Installing/Deinstalling Pytorch with torchvision.</p>
<p>I had problems importing torch.nn whilst having torch v 1.7.x and the respective torchvision. I ran “conda list torch” and it said there is no such module installed.</p>
<p>Then tried to deinstall in the Conda environment (despite it saying there is no such module) using both:<br>
-conda remove torch torchvision<br>
-pip deinstall torch torchvision</p>
<hr>
<p>Now “conda list torch” gave me version 1.7.x and the torchfile version</p>
<p>Ran the same commands again and now it gives 1.11.0 and torchfile version<br>
under Build it says pypi_0 and py_0 for torch and torchfile respectively and<br>
pypi and conda-forge for the “Channel”  for each one respectively.</p>
<p>I was thinking of manually deleting everything I see related to torch within the environment’s packages folder but am afraid to do so without a clear understanding if this might mess up other dependencies.</p>
<p>I don’t want to start over from scratch. My questions are:</p>
<ol>
<li>How should I proceed to purge and reinstall Torch for my conda evironment ( as I know setting up path manually is a necessity any such advice would be greatly appreciated)</li>
<li>Is there a specific torch version which is a minimum requirement in order to have the nn package? I am currently with Cuda 11.4 with cudnn 8.2.1. …<br>
The original file has Torch set for install at torch==1.7.1 torchvision==0.8.2</li>
</ol>
<p>Thanks in advance</p>

username: ptrblck
cooked: <aside class="quote no-group" data-username="Valery_Andreev" data-post="1" data-topic="146962">
<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/valery_andreev/48/47742_2.png" class="avatar"> Valery_Andreev:</div>
<blockquote>
<p>as I know setting up path manually is a necessity any such advice would be greatly appreciated</p>
</blockquote>
</aside>
<p>Setting manual paths should not be necessary and I’m unsure which paths you would like to set where.</p>
<ol>
<li>
<p>Rerun <code>pip uninstall torch -y</code> and <code>conda uninstall pytorch -y</code> a few times (same for <code>torchvison</code>) until both claim these packages cannot be found anymore. Afterwards reinstall the libs again. I would also be careful about installing packages in the <code>base</code> environment as I’ve had issues in the past where they were interacting with packages in other <code>conda</code> environments (I wasn’t able to narrow down why this was happening).</p>
</li>
<li>
<p>No, I think <code>torch.nn</code> was shipped in one of the very early relases already, so probably anything after some internal alpha releases should have this module.</p>
</li>
</ol>