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

one of the variables needed for gradient computation has been modified by an inplace operation #5

Open
cc421528 opened this issue Jun 10, 2023 · 3 comments

Comments

@cc421528
Copy link

Help: Have any classmates encountered this problem? I don't know how to solve it.
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [27, 32]], which is output 0 of ReluBackward0, is at version 1; expected version 0 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!

@wang-jing1
Copy link

帮助:有没有同学遇到过这个问题?我不知道如何解决它。运行时错误:梯度计算所需的变量之一已被就地操作修改:[torch.cuda.FloatTensor [27, 32]],这是 ReluBackward0 的输出 0,位于版本 1;预期版本 0 改为。提示:上面的回溯显示了计算梯度失败的操作。有问题的变量后来在那里或任何地方都发生了变化。祝你好运!

Yes, I'm having the same issue and don't know how to fix it yet.

@cc421528
Copy link
Author

cc421528 commented Jul 6, 2023

Hello, I have successfully resolved my issue: when I encountered this issue, my Pytorch version was 1.4. When I changed its version to 1.5, the issue was successfully resolved. I hope it can inspire you.

@wang-jing1
Copy link

您好,我已经成功解决了我的问题:当我遇到此问题时,我的 Pytorch 版本是 1.4。当我将其版本更改为 1.5 时,问题已成功解决。我希望它能激励你。

Thank you very much for your help. I can't wait to follow your instructions. Best wishes.

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

2 participants