dingkeyan93 / DISTS

IQA: Deep Image Structure and Texture Similarity Metric
MIT License
359 stars 42 forks source link

Unstable TensorFlow Training and a Fix #1

Closed fab-jul closed 4 years ago

fab-jul commented 4 years ago

I found the TensorFlow implementation causes NaN when I'm using it to train my deep CNN. This turns out to be due to the tf.sqrt(conv). Replacing it with return tf.sqrt(tf.maximum(conv, 1e-5)) fixes the problem! I saw the pytorch version does (out + 1e-12).sqrt(), so maybe that would be the proper way?

dingkeyan93 commented 4 years ago

Thanks. Fixed