Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K.function doesn't work #2

Closed
KiddoZhu opened this issue Sep 21, 2016 · 1 comment
Closed

K.function doesn't work #2

KiddoZhu opened this issue Sep 21, 2016 · 1 comment

Comments

@KiddoZhu
Copy link

KiddoZhu commented Sep 21, 2016

Hi
I follow your code to get the hidden layer output of an RNN. But it failed when I using K.function([model.layers[0].input], [model.layers[-1].output]), which causes an error:

MissingInputError: ("An input of the graph, used to compute DimShuffle{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)

So is there any trick in your code? Or probably because I load model with model_from_json and model.load_weights?

@KiddoZhu
Copy link
Author

The problem is solved. It is because I use dropout in my network.
See https://keras.io/getting-started/faq/#how-can-i-visualize-the-output-of-an-intermediate-layer

@jacobgil jacobgil closed this as completed Nov 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants