0

I am practicing Neural Style Transfer and am facing an issue here with the costs. After few iterations, the costs become NaN.. What might be the issue here? Where should I try to focus on?

Iteration 0 :
total cost = 1919359.6
content cost = 125.083374
style cost = 47952.72
Iteration 1 :
total cost = nan
content cost = nan
style cost = nan
Iteration 2 :
total cost = nan
content cost = nan
style cost = nan
Iteration 3 :
total cost = nan
content cost = nan
style cost = nan

Generally I don't have a good plan how to figure out where the nan happens. Especially with TensorFlow, where I am not familiar with the debugging techniques.

The code is here: https://github.com/enyangxxx/neuralStyleTransferMonet It is the code from a Coursera course and I want to apply it on my own themes later :)

halfer
  • 19,824
  • 17
  • 99
  • 186

1 Answers1

0

Might be a mishandled 0/0 error. Especially the case if you have created your own functions. Most probably it might be cross entropy. I believe you are not training with keras and just tensorflow. May be check out this ->Tensorflow NaN bug?

Then again this might not be your error. So it would be useful if you post the code.

EBIN JOSEPH
  • 58
  • 1
  • 6
  • Hi thanks for reaching out to me! https://github.com/enyangxxx/neuralStyleTransferMonet here is the repo, feel free to have a look :) thanks a loot! –  Aug 13 '19 at 22:58