Could I downgrade pytorch? or should I do something more after upgrading?

username: lili.ece.gwu
cooked: <p>Hello everyone, I have my own loss function, and it works well before I upgrade pytorch to the latest version by following the post <a href="https://discuss.pytorch.org/t/updating-pytorch/309" class="inline-onebox">Updating PyTorch</a>, then, my code does not work anymore, there is no warning or error but the program is stuck at the 146-th line of “variable.py”</p>
<blockquote>
<p>self._execution_engine.run_backward((self,), (gradient,), retain_variables)</p>
</blockquote>
<p>I even cannot step into it, and if I stop the program manually, it always shows</p>
<blockquote>
<p>Traceback (most recent call last):<br>
File “/home/lii/anaconda2/lib/python2.7/multiprocessing/process.py”, line 258, in _bootstrap<br>
self.run()<br>
File “/home/lii/anaconda2/lib/python2.7/multiprocessing/process.py”, line 114, in run<br>
self._target(*self._args, **self._kwargs)<br>
File “/home/lii/anaconda2/lib/python2.7/site-packages/torch/utils/data/dataloader.py”, line 28, in _worker_loop<br>
r = index_queue.get()<br>
File “/home/lii/anaconda2/lib/python2.7/multiprocessing/queues.py”, line 378, in get<br>
return recv()<br>
File “/home/lii/anaconda2/lib/python2.7/site-packages/torch/multiprocessing/queue.py”, line 21, in recv<br>
buf = self.recv_bytes()<br>
KeyboardInterrupt</p>
</blockquote>
<p>I am using anaconda2 in my workstation with CPU only, but the same code works well in GPU on a server with old pytorch version. So, could I downgrade pytorch or should I do something more?</p>
<p>Thank you!</p>

username: apaszke
cooked: <p>I don’t think it’s a problem of the newer version. You probably have very tight limits on the amount of shared memory in your system and it’s probably deadlocking everything. Are you trying to load very large images/videos?</p>

username: lili.ece.gwu
cooked: <p>Thank you so much for your reply, I did not load large data, I tried to load a 220-dimension data and reduced the batch size to 32, it does not work either. Is it possible to downgrade pytorch or do you have any other ideas? Thank you!</p>

username: smth
cooked: <p>if you wish to downgrade, you can.</p>
<pre><code class="lang-auto"># for example to install the previous version v0.1.10
conda install pytorch=0.1.10 -c soumith 
</code></pre>

username: lili.ece.gwu
cooked: <p>Thank you so much, after downgrading to 0.1.10, my code works again.</p>

username: smth
cooked: <p><a class="mention" href="/u/lili.ece.gwu">@lili.ece.gwu</a> if there is a way to share your code with me, i can look at why it is not working in the current version. thank you.</p>

username: Anurag_Koul
cooked: <p>Hi <a class="mention" href="/u/smth">@smth</a> Can you please share, how to downgrade to lower version using pip? I tried : <br><br>
pip install <a href="http://download.pytorch.org/whl/cu75/torch-0.1.10.post3-cp27-cp27mu-manylinux1_x86_64.whl" rel="nofollow noopener">http://download.pytorch.org/whl/cu75/torch-0.1.10.post3-cp27-cp27mu-manylinux1_x86_64.whl</a></p>
<p>However, this gives “Forbidden Error”</p>
<p>I had been wanting to do this, because after updating to the latest version, I hadn’t been able to run my previously working script on linux platforms.Also, the same script works fine with the latest version of pytorch on mac.</p>
<p>I have also tried increasing the memory segment size and made it equivalent to that available on Mac. However, even that didn’t helped me</p>
<p>Thank you</p>

username: sahilshah
cooked: <p>How do we do this via pip ?</p>

username: richard
cooked: <p>You can probably</p>
<pre><code class="lang-auto">wget  http://download.pytorch.org/whl/cu80/torch-0.1.12.post2-cp27-none-linux_x86_64.whl
pip install torch-0.1.12.post2-cp27-none-linux_x86_64.whl
</code></pre>
<p>if you want to install an older version of pytorch (0.12). That being said, I’m not sure I would recommend downgrading. If you let us know how your code is breaking in the current version of pytorch (0.20) we’d be glad to help.</p>

username: sahilshah
cooked: <p>Hi,</p>
<p>So there are several breaking points.</p>
<ol>
<li>I was a little less specific with the expand_as commands previously, and now it required me to use [:,None].expand_as()</li>
<li>assert on the value of a Variable is also failing now</li>
<li>These are obvious errors, a particular module of my code completely fails, now, when it was not earlier.</li>
</ol>

username: lili.ece.gwu
cooked: <p>I’ve worked on other things and I am trying to migrate my code to Pytorch 0.4, but failed now.</p><aside class="quote quote-modified" data-post="1" data-topic="18043">
  <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/lili.ece.gwu/48/15067_2.png" class="avatar">
    <a href="https://discuss.pytorch.org/t/backward-not-working-in-a-method-of-a-class/18043">.backward() not working in a method of a class</a> 
  </div>
  <blockquote>
    Hello everyone. I really need to embed a .backward() Function in a .forward() of another Function, but failed, help! 
x = np.array([[1.,2.], [3.,4.], [5.,6.]])
x = Variable(torch.from_numpy(x).float(), requires_grad=True)
y = var(x)
y.backward(y)     
# it works fine up to here
print(x.grad)       

# but -----------------
class Y_fun(Function):
    def forward(self, x):
        y = var(x)
        y.backward(y)
        print(x.grad)      # exact same thing, but in a forward method, failed
      …
  </blockquote>
</aside>
<p>
I want to know how may I downgrade to 0.1.10 <strong>including Torchvision and everything (Cuda etc…)</strong>,  in case the problem cannot be solved on time.</p>

username: Manish2261
cooked: <p>I am implementing an SSD Model, but at the point of converting the tensor into the torch Variable, I am facing deprication issues with the Torch version on my machine.<br>
So, if downgrading torch version will solve the issue or you could help me with the  coding mistake I am making.<br>
Initiallly i was doing this: x = torch.autograd.Variable(x.unsqueeze(0))</p>
<p>But due to deprication of variable function, I am facing issues for which I am trying to solve it as:</p>
<p>x = torch.autograd.Function.forward(x.unsqueeze(0))</p>

username: Manish2261
cooked: <p>I am implementing an SSD Model from amdegroot repo of github, and upon running the file geetting issue with the conversion of tensor into Variable as the direct variable function is deprecated in the new release of torch. How should I go further.</p>
<p>I was getting error due to this:   x = torch.autograd.Variable(x.unsqueeze(0))<br>
So, I tried this way  :  x = torch.autograd.backward(x),<br>
but still getting error :<br>
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn.</p>
<p>Will be very thankful for your help.</p>

username: ptrblck
cooked: <p><code>Variables</code> are deprecated since PyTorch <code>0.4</code> and you can use tensors now.<br>
Instead of</p>
<pre><code class="lang-python">x = torch.autograd.Variable(x.unsqueeze(0))
</code></pre>
<p>just use</p>
<pre><code class="lang-auto">x = x.unsqueeze(0)
</code></pre>