ylf-li / ContourGAN

Tensorflow for ContourGAN: Image Contour Detection with Generative Adversarial Encoder-Decoder Networks
73 stars 16 forks source link

Content Loss NaN #10

Open manutom opened 5 years ago

manutom commented 5 years ago

Epoch: [ 4/20] [2563/5760] learing_rate: 0.00000100 pos_weight:450.4373 context_loss: nan

from the fourth epoch onwards, context_loss has a value NaN while running demoTest.py

ylf-li commented 5 years ago

The weighted loss function you can use cost = tf.nn.weighted_cross_entropy_with_logits(logits=pred, targets=y, pos_weight=pos_weight) and set the pos_weighted with 15 in BSDS500 and nan can be alleviated by decrease the learning rate.

manutom commented 5 years ago

I tried with a learning rate of 1e10. at some point the pos_weight becomes infinity and the loss becomes nan then onwards. Now trying with a fixed pos_weight value (=15). It is very much appreciated if you can provide the code with parameters which converged at least on one dataset (say BSDS)

manutom commented 5 years ago

demoTest.py converged (20 epochs) with the following settings on BSDS: 1) LR = 1e10, pos_weight=15 2) LR = 1e11, pos_weight=15

But the contour detection fails :(

It was a waste of time experimenting with this code