Hello everyone, I have my own loss function, and it works well before I upgrade pytorch to the latest version by following the post Updating PyTorch, 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”
I even cannot step into it, and if I stop the program manually, it always shows
Traceback (most recent call last):
File “/home/lii/anaconda2/lib/python2.7/multiprocessing/process.py”, line 258, in _bootstrap
File “/home/lii/anaconda2/lib/python2.7/multiprocessing/process.py”, line 114, in run
File “/home/lii/anaconda2/lib/python2.7/site-packages/torch/utils/data/dataloader.py”, line 28, in _worker_loop
r = index_queue.get()
File “/home/lii/anaconda2/lib/python2.7/multiprocessing/queues.py”, line 378, in get
File “/home/lii/anaconda2/lib/python2.7/site-packages/torch/multiprocessing/queue.py”, line 21, in recv
buf = self.recv_bytes()
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?
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?
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!
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.
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
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.
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.
So, if downgrading torch version will solve the issue or you could help me with the coding mistake I am making.
Initiallly i was doing this: x = torch.autograd.Variable(x.unsqueeze(0))
But due to deprication of variable function, I am facing issues for which I am trying to solve it as:
x = torch.autograd.Function.forward(x.unsqueeze(0))
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.
I was getting error due to this: x = torch.autograd.Variable(x.unsqueeze(0))
So, I tried this way : x = torch.autograd.backward(x),
but still getting error :
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn.