several Keras-based examples stop execution on model.fit at "Epoch 0" without throwing an error

1,394 views
Skip to first unread message

nicolai...@gmail.com

unread,
Jul 15, 2015, 8:17:45 PM7/15/15
to keras...@googlegroups.com
Hi,

I've recently had my interest in neural networks rekindled (I used them a lot in college), and after some initial tinkering with PyBrain, I've decided I'll try and use Keras as my platform of choice for actual use.

Unfortunately, several examples that I've tried all fail in the same, confusing way. This is the output I'm getting from the code part that runs model.fit(..): 

 # and now train the model
Train on 15286 samples, validate on 805 samples
Epoch 0

All examples I tried (and made up myself) fail like this - execution simply stops, with no errors, no exceptions, no nothing. This is the code piece (HT http://www.danielhnyk.cz/blog) that produces the above output:

(X_train, y_train), (X_test, y_test) = train_test_split(data)  # retrieve data

print("# and now train the model")
# batch_size should be appropriate to your memory size
# number of epochs should be higher for real world problems
model.fit(X_train, y_train, batch_size=450, nb_epoch=10, validation_split=0.05)

print("RESULTS!")
predicted = model.predict(X_test)
rmse = np.sqrt(((predicted - y_test) ** 2).mean(axis=0))

# and maybe plot it
pd.DataFrame(predicted[:100]).plot()
pd.DataFrame(y_test[:100]).plot()

As you can see, there was supposedly more code after model.fit(), but it never gets called. 

Do any of you guys have an idea where i can start looking? I have theano running in CPU mode (no CUDA installed yet, will try that tomorrow), with MinGW in the path. Platform is Win7 64-bit.

Thanks in advance!
  Nico 

nicolai...@gmail.com

unread,
Jul 16, 2015, 7:29:44 AM7/16/15
to keras...@googlegroups.com, nicolai...@gmail.com
I have some more information about when the issue does and doesn't occur:

- It doesn't occur in examples that use only Dense layers
- it does occur in examples that use LSTM layers
- it sometimes (still researching when) doesn't occur in LSTM layers with a small amount of neurons
- it is dependent on batch size in LSTM networks

Any help would be greatly appreciated. I would really love to use Keras, but so far it has been extremely unstable for my use case, which will heavily rely on RNNs.

  Nico

alber...@gmail.com

unread,
Jul 28, 2015, 11:23:06 AM7/28/15
to Keras-users, nicolai...@gmail.com
I'm having similar issues too. Running code on two Ubuntu machines, one on CPU (Python 3.4) and one on GPU (Python 2.7).

François Chollet

unread,
Jul 28, 2015, 11:41:14 AM7/28/15
to alber...@gmail.com, Keras-users, nicolai...@gmail.com
This looks like a Theano bug (a segfault or similar). Theano is known to be somewhat unstable on Windows, but it works decently on Unix systems. There is little I can do to help you, you can try submitting a bug report with the Theano devs, especially if you can reliably reproduce the issue.

Any Keras bug would trigger a traceback (either Python or Theano). A crash with no feedback means that the issue is with Theano's C code (or with the Python interpreter, but that is much much less likely).



--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/061b9a24-379f-4790-b08d-a5b0e698e997%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

hny...@gmail.com

unread,
Oct 8, 2015, 5:03:30 AM10/8/15
to Keras-users, nicolai...@gmail.com
The new link is here: http://danielhnyk.cz/predicting-sequences-vectors-keras-using-rnn-lstm/

Dne čtvrtek 16. července 2015 2:17:45 UTC+2 nicolai...@gmail.com napsal(a):

Rohit Kumar

unread,
Jan 8, 2016, 5:21:29 AM1/8/16
to Keras-users
Python.exe fail/crash
I am too having this error. First, the model.compile takes a long time (Is it normal?). Then as soon it reaches model.fit function, python.exe fails.
Anybody found a reason?

Regards,

Rohit

Reply all
Reply to author
Forward
0 new messages