You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
model = Sequential()
model.add(Convolution2D(32, 3, 3, border_mode='valid', input_shape=X_train.shape[1:]))
model.add(Dropout(0.01)) # This breaks it
convout1 = Activation('relu')
model.add(convout1)
model.add(Convolution2D(32, 3, 3))
I get the following error message:
MissingInputError: ("An input of the graph, used to compute DimShuffle{x,x,x,x}(keras_learning_phase), was not provided and not given a value.Use the Theano flag exception_verbosity='high',for more information on this error.", keras_learning_phase)
The error makes sense - the dropout layer needs to know whether it's training time or test time in order to decide whether or not to do dropout - but I don't know how to pass in the learning phase parameter.
The text was updated successfully, but these errors were encountered:
but I don't know how to pass in the learning phase parameter.
You add K.learning_phase() as an input to your function, and when calling the function you pass 1 or 0 as value for the learning phase. This is covered in the FAQ.
In this example https://github.com/julienr/ipynb_playground/blob/master/keras/convmnist/keras_cnn_mnist_v1.ipynb the author is able to build a backend function to get the output of a specific layer of a NN. If I modify the example to include dropout, for instance making the following change to cell 7, it no longer works.
I get the following error message:
The error makes sense - the dropout layer needs to know whether it's training time or test time in order to decide whether or not to do dropout - but I don't know how to pass in the learning phase parameter.
The text was updated successfully, but these errors were encountered: