赞
踩
您在 pytorch 中遇到如下错误。
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor []], which is output 0 of SelectBackward, is at version 4; expected version 3 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient.!
这意味着你使用张量或其部分来计算同一张量的一部分。下面的代码演示了这个错误。
- import pytorch3d.transforms
- import torch
- euler_angles = torch.nn.Parameter(torch.Tensor([0.1, 0.03,-0.2]))
- target = torch.eye(3)
- torch
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。