Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a problem with the backpropagation process #2

Open
cloudyliy opened this issue Dec 22, 2020 · 5 comments
Open

a problem with the backpropagation process #2

cloudyliy opened this issue Dec 22, 2020 · 5 comments

Comments

@cloudyliy
Copy link

The following error occurred when running the code:

File "/home/xxx/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/tensor.py", line 102, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/xxx/anaconda3/envs/pytorch/lib/python3.6/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

It seems that there is a problem with the backpropagation process. Has the author encountered such a problem? My pytorch version is 1.1.0, thank you!

@dectrfov
Copy link
Owner

Thanks for your interest.
Can you show the detailed error message?
In our machine, I don't encounter this condition.

Best Regards

@luoxiaodou
Copy link

The following error occurred when running the code:

File "/home/xxx/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/tensor.py", line 102, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/xxx/anaconda3/envs/pytorch/lib/python3.6/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

It seems that there is a problem with the backpropagation process. Has the author encountered such a problem? My pytorch version is 1.1.0, thank you!

I also encounter the problem, do you solve it? Could you tell me the solutions?

@zj1010
Copy link

zj1010 commented Apr 15, 2023

The following error occurred when running the code:
File "/home/xxx/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/tensor.py", line 102, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/xxx/anaconda3/envs/pytorch/lib/python3.6/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
It seems that there is a problem with the backpropagation process. Has the author encountered such a problem? My pytorch version is 1.1.0, thank you!

I also encounter the problem, do you solve it? Could you tell me the solutions?

I met the same problem,do you solve it?

@Ypigeon
Copy link

Ypigeon commented Mar 6, 2024

运行代码时出现以下错误:文件“/home/xxx/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/tensor.py”第102行,向后torch.autograd.backward(自我,渐变,保留_graph,create_graph)文件“/home/xxx/anaconda3/envs/pytorch/lib/python3.6/site-packages/torch/autograd/init.py”,第90行,向后allow_unreachable=True) # allow_unreachable标志RuntimeError:梯度计算所需的一个变量就就地修改反向传播过程似乎存在问题。作者遇到过这样的问题吗?我的pytorch版本是1.1.0,谢谢!> >> >> > 我也遇到了这个问题,你解决了吗?你能告诉我解决方案吗?>> 我遇到了同样的问题,你解决了吗?

@xiaowowwwww
Copy link

Hello, I also have the above problem, I would like to ask if there is any solution? Thank you!
Traceback (most recent call last):
File "D:\Wavelet-U-net-Dehazing-master\train.py", line 130, in
main(config_args)
File "D:\Wavelet-U-net-Dehazing-master\train.py", line 96, in main
loss.backward()
File "D:\anaconda\envs\pytorch\lib\site-packages\torch_tensor.py", line 488, in backward
torch.autograd.backward(
File "D:\anaconda\envs\pytorch\lib\site-packages\torch\autograd_init_.py", line 197, in backward
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [16, 4, 64, 64]], which is output 0 of AsStridedBackward0, is at version 16; expected version 15 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants