Created
October 24, 2016 16:06
-
-
Save sjebbara/7ce65d93189def211a743a04514636b1 to your computer and use it in GitHub Desktop.
MissingInputError in Keras: Distributing any layer that uses the learning phase throws an exception
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.models import Model | |
from keras.layers import Input, TimeDistributed, Dropout | |
in1 = Input(batch_shape=(10, 8, 6), name="in1") | |
# The following Dropout() layer is closely related to the error, | |
# although the error is thrown at the model._make_predict_function() | |
# Exchanging Dropout() with other layers that use the learning phase (e.g. GaussianNoise()) | |
# causes the same issues. | |
# Other layer, like Dense() work perfectly. | |
out1 = TimeDistributed(Dropout(0.5))(in1) | |
model = Model(input=in1, output=out1) | |
model.compile("adam", "mse") | |
model._make_predict_function() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment