2021
06-23
06-23
pytorch loss反向传播出错的解决方案
今天在使用pytorch进行训练,在运行loss.backward()误差反向传播时出错:RuntimeError:gradcanbeimplicitlycreatedonlyforscalaroutputsFile"train.py",line143,intrainloss.backward()File"/usr/local/lib/python3.6/dist-packages/torch/tensor.py",line198,inbackwardtorch.autograd.backward(self,gradient,retain_graph,create_graph)File"/usr/local/lib/python3.6/dist-packages/torch/autograd/...
继续阅读 >