Getting error Sequential object has no attribute _train

2,076 views
Skip to first unread message

Arthi Venkataraman

unread,
Sep 6, 2015, 6:51:46 AM9/6/15
to Keras-users
Hi,
  I was trying the lstm_text_generation.py example.

The change I did was to modify for different data set.

Also train X and y with different values .

Objective is to predict the y text sequence given X.
Iam getting error Sequential object has no attribute _train.


Why is this error happening?
What do I need to do to fix this issue?

I compared the types returned by the modified code and they match the lstm_text_generation code.

ERROR (theano.sandbox.cuda): nvcc compiler not found on $PATH. Check your nvcc installation and try again.
total chars: 2763
Vectorization...
Build model...
type of x: <type 'numpy.ndarray'> (220, 41, 2763)
type of y: <type 'numpy.ndarray'> (220, 2763)
Traceback (most recent call last):
  File "myAnswerGenerator.py", line 153, in <module>
    model.fit(X, y, batch_size=40, nb_epoch=1)
  File "build/bdist.linux-x86_64/egg/keras/models.py", line 469, in fit
AttributeError: 'Sequential' object has no attribute '_train'

François Chollet

unread,
Sep 6, 2015, 2:01:46 PM9/6/15
to Arthi Venkataraman, Keras-users
Most likely you are not compiling your model. The _train function is added at compilation time.

--
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/700aa994-766a-4761-b08b-575a1c081370%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Arthi Venkataraman

unread,
Sep 6, 2015, 10:16:17 PM9/6/15
to Keras-users, v.ar...@gmail.com
Thanks , that fixed this issue.
Reply all
Reply to author
Forward
0 new messages