1、报错:RuntimError:one of the variables needed for gradient computation has been modified by an inplace operation:
解决方案:更换torch版本,以下版本可以正常运行。
2、报错RuntimeError: CUDA error: device-side assert triggered Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions.
解决方案:代码中设置:详细定位错误
import os
os.environ['CUDA_LAUNCH_BLOCKING'] = '1'
os.environ['TORCH_USE_CUDA_DSA'] = '1'