can't find the inplace operation: one of the variables needed for gradient computation has been modified by an inplace operation

后端 未结 3 1999
孤独总比滥情好
孤独总比滥情好 2021-01-15 11:24

I am trying to compute a loss on the jacobian of the network (i.e. to perform double backprop), and I get the following error: RuntimeError: one of the variables needed for

3条回答
  •  迷失自我
    2021-01-15 11:52

    You can make use of set_detect_anomaly function available in autograd package to exactly find which line is responsible for the error.

    Here is the link which describes the same problem and a solution using the abovementioned function.

提交回复
热议问题