Neural style transfer from tensorflow docs returns NaN loss

Viewed 19

I am getting some strange results following the tensorflow tutorial for neural style transfer at https://www.tensorflow.org/tutorials/generative/style_transfer

It seems like, depending on the resolution of the images, and the style weight parameter, sometimes the loss goes to a NaN value, which prevents the script from working properly.

In particular, large images or larger values for the style weight make for a larger starting loss, and I was thinking that maybe it could overflow in some way and thus become a NaN, but should it become a float('inf') in that case?

What condition, in general, can bring the loss of a VGG-based model to be a NaN, provided that the input data is valid?

0 Answers
Related