MXNetError:[15:07:19] C:\Jenkins\workspace\mxnet-tag\mxnet\src\imperative\imperative.cc:295:

请问这个错误怎么解决呀?
[15:07:19] C:\Jenkins\workspace\mxnet-tag\mxnet\src\imperative\imperative.cc:295: Check failed: !AGInfo::IsNone(*i): Cannot differentiate node because it is not in a computational graph. You need to set is_recording to true or use autograd.record() to save computational graphs for backward. If you want to differentiate the same graph twice, you need to pass retain_graph=True to backward

请问解决没有哇?

解决了 :joy:

你好,我也出现了相同的问题,你是怎么解决的,可以分享一下嘛?

You need to set is_recording to true or use autograd.record() to save computational graphs for backward
估计没有通过autograd.record()记录生成计算图,然后就反向传播l.backward()了吧?
这样才能生成计算图以及记录梯度

with autograd.record():
       y_hat = net(x)
       l = loss(y_hat, y)
l.backward()