Wednesday, 23 December 2020

Train cost is producing Nan Value in Tensorflow Code Example

I'm sure it's a simple question for someone who specializes in TensorFlow, but I couldn't solve it.

I am trying to execute the following code from Github.

https://github.com/drhuangliwei/An-Attention-based-Spatiotemporal-LSTM-Network-for-Next-POI-Recommendation

When I run AT-LSTM.py, line 240 is producing like below

if(global_steps%100==0):
            print("the %i step, train cost is: %f"%(global_steps,cost))
        global_steps+=1

Output

 the 100 step, train cost is: nan
    the 200 step, train cost is: nan
    the 300 step, train cost is: nan
    the 400 step, train cost is: nan
    the 500 step, train cost is: nan
    the 600 step, train cost is: nan
    the 700 step, train cost is: nan
    the 800 step, train cost is: nan
    the 900 step, train cost is: nan
    the 1000 step, train cost is: nan
    the 1100 step, train cost is: nan
    the 1200 step, train cost is: nan
    the 1300 step, train cost is: nan
    the 1400 step, train cost is: nan
    the 1500 step, train cost is: nan
    the 1600 step, train cost is: nan
    the 1700 step, train cost is: nan
    the 1800 step, train cost is: nan
    the 1900 step, train cost is: nan
    the 2000 step, train cost is: nan
    the 2100 step, train cost is: nan
    the 2200 step, train cost is: nan
    the 2300 step, train cost is: nan
    the 2400 step, train cost is: nan
    the 2500 step, train cost is: nan
    the 2600 step, train cost is: nan
    the 2700 step, train cost is: nan
    the 2800 step, train cost is: nan
    the 2900 step, train cost is: nan
    the 3000 step, train cost is: nan
    the 3100 step, train cost is: nan
    the 3200 step, train cost is: nan

Each iteration cost value is getting Nan value. Do you have any idea why I am getting Nan value in every iteration



from Train cost is producing Nan Value in Tensorflow Code Example

No comments:

Post a Comment