gazounu
@gazounu

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

RuntimeError: Trying to backward through the graph a second time (or directly access saved tensors after they have already been freed).

解決したいこと

lossのbackwardのところでエラーが発生します。
対処法を教えてください。

発生している問題・エラー

RuntimeError: Trying to backward through the graph a second time (or directly access saved tensors after they have already been freed). Saved intermediate values of the graph are freed when you call .backward() or autograd.grad(). Specify retain_graph=True if you need to backward through the graph a second time or if you need to access saved tensors after calling backward
0

1Answer

Your answer might help someone💌