I encountered this problem when running in mode "0" to train image-wise network after done training patch-wise one.
Traceback (most recent call last):
File "train.py", line 18, in
iw_model.train()
File "/home/xiaohui8/SR/ICIAR2018/src/models.py", line 300, in train
loss.backward()
File "/home/xiaohui8/miniconda3/envs/pytorch-CycleGAN-and-pix2pix/lib/python3.5/site-packages/torch/tensor.py", line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/xiaohui8/miniconda3/envs/pytorch-CycleGAN-and-pix2pix/lib/python3.5/site-packages/torch/autograd/init.py", line 90, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation
I encountered this problem when running in mode "0" to train image-wise network after done training patch-wise one.
Traceback (most recent call last):
File "train.py", line 18, in
iw_model.train()
File "/home/xiaohui8/SR/ICIAR2018/src/models.py", line 300, in train
loss.backward()
File "/home/xiaohui8/miniconda3/envs/pytorch-CycleGAN-and-pix2pix/lib/python3.5/site-packages/torch/tensor.py", line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/xiaohui8/miniconda3/envs/pytorch-CycleGAN-and-pix2pix/lib/python3.5/site-packages/torch/autograd/init.py", line 90, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation