PyTorch版本:1.4.0+cu100运行时
val_L= Variable(torch.from_numpy(val_L.copy()), volatile=True).cuda()
发生:
UserWarning: volatile was removed and now has no essfet. Use 'with torch.no_grad():' insted.
那么,我应该如何修改代码呢?非常感谢!!!
这就是它所指的
with torch.no_grad():
val_L= Variable(torch.from_numpy(val_L.copy()))