os.environ["CUDA_VISIBLE_DEVICES"]="1"
var_args = vars(args)
for key, var in var_args.items():
print(key, var)
import matplotlib as mpl
mpl.use('ps')
import matplotlib.pyplot as plt
https://github.com/matplotlib/matplotlib/issues/6531/
AssertionError: nn criterions don’t compute the gradient w.r.t. targets - please mark these variables as volatile or not requiring gradients
vgg 같은 네트워크를 활용해서 perceptual loss를 구할때 생기는 문제 output, target = vggmodel(SR), vggmodel(HR) Loss = L2(output, target) target = target.detach()이 아니라 L2(output, target.detach())로 해결
a.find('b') > -1 이면 a안에 b
with torch.no_grad(): 부분을 psnr 등 계산하는 부분
HR = HR.detach()로 하면 해결