0

I used the same code from this example https://github.com/fchollet/keras/blob/master/examples/imdb_cnn.py

But the result is really bad: loss: non - acc: 0

Using Theano backend.
DEBUG: nvcc STDOUT mod.cu
Creating library D:/Users/lenovo/AppData/Local/Theano/compiledir_Windows-8.1-6.3.9600-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.12-64/tmpccono5/265abc51f7c376c224983485238ff1a5.lib and object D:/Users/lenovo/AppData/Local/Theano/compiledir_Windows-8.1-6.3.9600-Intel64_Family_6_Model_60_Stepping_3_GenuineIntel-2.7.12-64/tmpccono5/265abc51f7c376c224983485238ff1a5.exp

Using gpu device 0: GeForce GTX 860M (CNMeM is enabled with initial size: 70.0% of memory, cuDNN 5005)
Loading data...
25000 train sequences
25000 test sequences
Pad sequences (samples x time)
X_train shape: (25000L, 400L)
X_test shape: (25000L, 400L)
Build model...
Train on 25000 samples, validate on 25000 samples
Epoch 1/2
25000/25000 [==============================] - 23s - loss: nan - acc: 7.2000e-04 - val_loss: nan - val_acc: 0.0000e+00
Epoch 2/2
25000/25000 [==============================] - 23s - loss: nan - acc: 0.0000e+00 - val_loss: nan - val_acc: 0.0000e+00

Process finished with exit code 0

Can anyone help me figure out how to solve this problem? Thanks!

  • Start your model with `THEANO_FLAGS=mode=NanGuardMode` and work your way up from there. See also Theano's [NaN debugging tutorial](http://deeplearning.net/software/theano/tutorial/nan_tutorial.html). – nemo Sep 07 '16 at 13:59
  • 1
    I think your problem may be similar to this question. http://stackoverflow.com/questions/37232782/nan-when-training-regression-net-using-keras-and-theano/41517381#41517381. – HenryZhao Jan 07 '17 at 08:47

0 Answers0