RuntimeError: Cant call numpy() on Variable that requires grad. Use var.detach().numpy() instead.
在训练github上源码时遇到了这一问题RuntimeError:Can'tcallnumpy()onVariablethatrequiresgrad.Usevar.detach().numpy()instead.但由于这一步报错代码在计算lossloss=np.sum([criterion(torch.clamp(restored[j],0,1),target)forjinrange(len(r