先说最终解决办法:降低cudatoolkit、pytorch版本。 详细解决过程如下:
一直都是在cuda9.0, pytorch1.1.0的环境里跑模型,最近换了新服务器、不支持这么低版本的cuda了,只好安装cuda 11.6.0 pytorch3.8.0的环境。不料在运行到第194行时出现了以下bug:
File "。。/python3.8/site-packages/torch/distributions/distribution.py", line 55, in __init__ raise ValueError( ValueError: Expected parameter scale (Tensor of shape (128, 8, 8)) of distribution Laplace(loc: torch.Size([128, 8, 8]), scale: torch.Size([128, 8, 8])) to satisfy the constraint GreaterThan(lower_bound=0.0), but found invalid values: tensor(。。。