Skip to content

406_GAN.py:报梯度计算时变量被inplace操作修改错误 #89

Closed
@xub-xubin

Description

Morvan老师,

你好!我在运行406_GAN.py时,报了如下错误:
RuntimeError: one of the variables needed for gradient computation has been modified by an inplace operation: [torch.FloatTensor [128, 1]], which is output 0 of TBackward, is at version 2; expected version 1 instead. Hint: the backtrace further above shows the operation that failed to compute its gradient. The variable in question was changed in there or anywhere later. Good luck!
能帮忙看一下是什么原因吗?谢谢

使用版本:
pytorch:1.5.0
python:3.7.4

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions