Open afourast opened 7 years ago
I get the same error - have you managed to resolve it?
I realize that this thread is quite old, but since I recently stumbled on recurrentshop, I also experienced this bug. As it turns out, the example from the documentation didn't work even when it was pushed on Github in April. Here is a quick fix, that will allow you to run the example:
Simply change the backend of keras to theano.
Either do this by following the instructions here (which didn't work for me) or run your code with KERAS_BACKEND=theano python your_teacher_enforcing_file.py
.
Hope this helps!
Agree with @Cyberdog52 , I have the similar Error when I try to run example from documentation, with readout=True and teacher_force=True:
ValueError: Initializer for variable recurrent_sequential_1/while/Variable/ is from inside a control-flow construct, such as a loop or conditional. When creating a variable inside a loop or conditional, use a lambda as the initializer.
And finally I change the backend to theano, and the problem gone.
keras version = 2.0.8 tf version = 1.3.0 theano version = 0.9.0
When running the teacher force example from documentation with tf backend I get
tensorflow.python.framework.errors_impl.InvalidArgumentError: The node 'recurrent_sequential_1/while_1/Variable_1/Assign' has inputs from different frames. The input 'recurrent_sequential_1/while_1/Const_1' is in frame 'recurrent_sequential_1/while_1/recurrent_sequential_1/while_1/'. The input 'recurrent_sequential_1/while_1/Variable_1' is in frame ''.
tf version = 1.2.0 keras version = 2.0.5