UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach()
1、UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).解决:
·
1、UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).
解决:
将
theta_init_new = torch.tensor(theta, dtype=torch.float32, requires_grad=True)
改为
theta_init_new = torch.as_tensor(theta, dtype=torch.float32, requires_grad=True)
2、‘bool’ object is not iterable
解决:
更多推荐
已为社区贡献3条内容
所有评论(0)