pytorch吧 关注:1,211贴子:2,258
  • 4回复贴,共1

我的神经网络更是的时候, 再 .backward 的时候程序总是卡死

只看楼主收藏回复

Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
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.


IP属地:澳大利亚1楼2023-12-14 10:44回复
    下面那段话指出了你程序中可能存在的问题


    IP属地:北京来自Android客户端3楼2023-12-14 12:36
    收起回复


      IP属地:浙江来自Android客户端5楼2023-12-14 12:43
      收起回复