Pytorch日常debug记录(二)

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).
解决:如下图所示,将torch.tensor()改成torch.as_tensor() 

你可能感兴趣的:(笔记,pytorch,python,深度学习,神经网络,debug)