解決方法是:在我們要使用模型產出的時候,將其放在with torch.no_grad() 底下,這樣一來,模型就不會累積梯度。 References. https://discuss.pytorch.
確定! 回上一頁