VITA-Group / EnlightenGAN

[IEEE TIP] "EnlightenGAN: Deep Light Enhancement without Paired Supervision" by Yifan Jiang, Xinyu Gong, Ding Liu, Yu Cheng, Chen Fang, Xiaohui Shen, Jianchao Yang, Pan Zhou, Zhangyang Wang
Other
890 stars 198 forks source link

Some quesions about training #93

Closed sys706 closed 3 years ago

sys706 commented 3 years ago

Thank you for your excellent work. I always get this kind of errors every time I train. How do I resolve this? If you can help me solve this problem, I will be very grateful.

create web directory ./checkpoints/enlightening/web...

/home/a706/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py:2390: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead. warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")

/home/a706/anaconda3/lib/python3.7/site-packages/torch/nn/functional.py:2479: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details. "See the documentation of nn.Upsample for details.".format(mode))

Traceback (most recent call last): File "train.py", line 37, in errors = model.get_current_errors(epoch) File "/home/a706/ys/imageEnhancement/EnlightenGAN-master-gpu/models/single_model.py", line 413, in get_current_errors D_A = self.loss_D_A.data[0] IndexError: invalid index of a 0-dim tensor. Use tensor.item() to convert a 0-dim tensor to a Python number

yifanjiang19 commented 3 years ago

You might need to replace .data[0] with .item() for pytorch version>=0.4.0

sys706 commented 3 years ago

You might need to replace .data[0] with .item() for pytorch version>=0.4.0

Thank you very much for your help. This problem has been solved.