梯度计算所需的一个变量已通过就地操作修改[torch.cuda.FloatTensor[1,64,3,3,3]]

2024-05-12 09:59:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我目前正在使用功能磁共振成像数据集研究3D-GAN。我参考了github的代码,https://github.com/cyclomon/3dbraingen/blob/master/VAEGAN_ADNI_train.ipynb

我以前从未见过的错误一直在发生

有人能帮我解决这个问题吗

错误如下: RunTimeError

RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.cuda.FloatTensor [1, 64, 3, 3, 3]] is at version 2; expected version 1 instead.

培训代码如下所示:

Code1Code2


Tags: 数据代码https功能githubmastercomversion