UserWarning: volatile was removed and now has no effect. Use `with torch.no_grad():` instead.

451 阅读1分钟

noises = Variable(noises, volatile=True)

改为:

with torch.no_grad():
    noises = Variable(noises)