小编mea*_*dow的帖子

即使在loss.backward()之后,output.grad也没有

我很困惑...

我的模型输出: tensor([[0.0000,0.1537],...],grad_fn=<ReluBackward0>)

If I use print(output.grad) it gives me None but even after gradient computation with loss.backward() I get the same result, which again is None...

Even with with torch.set_grad_enabled(True): added, still the same.

I've tried now with multiple model variants, always the same.

I was achieving good result with my model there seemed no problem, now I see this and I'm not sure any more if there not might be a major flaw I didn't recognized so …

python machine-learning pytorch

1
推荐指数
1
解决办法
6413
查看次数

标签 统计

machine-learning ×1

python ×1

pytorch ×1