Open Source Image and Video Restoration Toolbox for Super-resolution, Denoise, Deblurring, etc. Currently, it includes EDSR, RCAN, SRResNet, SRGAN, ESRGAN, EDVR, BasicVSR, SwinIR, ECBSR, etc. Also support StyleGAN2, DFDNet.
The loss of my gan looks very strange. I used a lightweight esrgan, so I also reduced the gan. The weight of the two models is about 2-3Mb. I use the lr strategy of TTUR, and nothing else has changed. I have trained the gan method many times, and the loss of gan has risen.
请问您在使用ganloss时有遇到以下的问题吗?如果有的话请问是怎么解决的呢?
Traceback (most recent call last):
File "basicsr/train.py", line 216, in
train_pipeline(root_path)
File "basicsr/train.py", line 169, in train_pipeline
model.optimize_parameters(current_iter)
File "/hdd/u202320081001026/DAT-main/basicsr/models/sr_model.py", line 105, in optimize_parameters
l_percep, l_style = self.cri_perceptual(self.output, self.gt)
File "/home/u202320081001026/anaconda3/envs/DAT/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1532, in _wrapped_call_impl
return self._call_impl(*args, *kwargs)
File "/home/u202320081001026/anaconda3/envs/DAT/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1541, in _call_impl
return forward_call(args, **kwargs)
File "/hdd/u202320081001026/DAT-main/basicsr/losses/losses.py", line 353, in forward
target_label = self.get_target_label(input, target_is_real)
File "/hdd/u202320081001026/DAT-main/basicsr/losses/losses.py", line 334, in get_target_label
target_val = (self.real_label_val if target_is_real else self.fake_label_val)
RuntimeError: Boolean value of Tensor with more than one value is ambiguous
The loss of my gan looks very strange. I used a lightweight esrgan, so I also reduced the gan. The weight of the two models is about 2-3Mb. I use the lr strategy of TTUR, and nothing else has changed. I have trained the gan method many times, and the loss of gan has risen.
Default esrgan configuration
Lightweight esrgan model crashes
Adjusted lr and perceptual loss weight = 0.05
Configuration of the 3rd picture