MaybeShewill-CV / attentive-gan-derainnet

Unofficial tensorflow implemention of "Attentive Generative Adversarial Network for Raindrop Removal from A Single Image (CVPR 2018) " model https://maybeshewill-cv.github.io/attentive-gan-derainnet/
MIT License
258 stars 83 forks source link

loss function #52

Closed chenhuiphd closed 5 years ago

chenhuiphd commented 5 years ago

hi,Negative sign is added before the lgan variable in line 69 of the derain_drop_net.py file to make lgan positive? Right? thx

MaybeShewill-CV commented 5 years ago

@chenhuiphd the inference result was the output of a sigmoid function:)

chenhuiphd commented 5 years ago

yes, My TF version is 1.10.The range of discriminate_inference value is between (0-1), so log (1-discriminate_inference) is negative. When I train, I find that generator loss will start to appear negative, and finally Nan will appear. So I think adding negative sign before lgan can make lgan positive, so that loss can be avoided in the case of negative numbers or nan.

MaybeShewill-CV commented 5 years ago

@chenhuiphd I have met the same problem with tf 1.3 but nothing happened when I upgrade tensorflow from 1.3 into 1.12. Amazing tensorflow:)

YangSN0719 commented 5 years ago

FileNotFoundError: [Errno 2] No such file or directory: './data/vgg16.npy'

YangSN0719 commented 5 years ago

After downloading the file, the following problems occurred again. I hope you can help me when you see the message. Thank you very much

Traceback (most recent call last): File "tools/train_model.py", line 339, in train_model(args.dataset_dir, weights_path=args.weights_path) File "tools/train_model.py", line 272, in train_model encoding='latin1').item() File "/home/409/anaconda3/envs/derain/lib/python3.5/site-packages/numpy/lib/npyio.py", line 453, in load pickle_kwargs=pickle_kwargs) File "/home/409/anaconda3/envs/derain/lib/python3.5/site-packages/numpy/lib/format.py", line 722, in read_array raise ValueError("Object arrays cannot be loaded when " ValueError: Object arrays cannot be loaded when allow_pickle=False

YangSN0719 commented 5 years ago

是numpy的版本没处理好,参考https://blog.csdn.net/qq_35008279/article/details/89496094已经解决