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
get mid-model activations is very slow #4006
Comments
You could maybe try reusing the
|
+1, Speed is also a problem for me. Also is there a way to send batch test data (like multiple images, say 100K) to this function and get activations of a layer for all the 100K images in a list? Will that be faster due to some matrix multiplication perhaps (not sure)? I have seen some answers where u send a batch test data but end up iterating over them when passed as arguments to the K.function which I would think is same as calling get_activations many times with a list of images? Please help.. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, but feel free to re-open it if needed. |
from keras import backend as K def get_activations(model, layer, X_batch): my_featuremaps = get_activations(cnn, 1, ([X_train[:10], 0])[0]) The above code is generating the below error with TensorFlow as backend TypeError: outputs of a TensorFlow backend function should be a list or tuple. Actually, this works fins with theano as backend |
1 similar comment
from keras import backend as K def get_activations(model, layer, X_batch): my_featuremaps = get_activations(cnn, 1, ([X_train[:10], 0])[0]) The above code is generating the below error with TensorFlow as backend TypeError: outputs of a TensorFlow backend function should be a list or tuple. Actually, this works fins with theano as backend |
I have the same problem - retrieving hidden layer activations takes as long as training the model. It would be very cool if there was an efficient way of retrieving hidden layer activity for multiple layers and multiple inputs. |
@IraZarI @jona-sassenhagen @robertomest
how to rewrite it? thanks. |
Please make sure that the boxes below are checked before you submit your issue. Thank you!
pip install git+git://github.com/fchollet/keras.git --upgrade --no-deps
Hey,
i implemented this tool to get the activations of a net for a specific layer like suggested in #41 (and many more)
so everythings works flawless and i love this functionallity, but it has one gamebreaker for me: Speed.
this Calculation for a given model with 3-4 Layers (20 neurons width each, Dense) takes about half of a second.
Since i want to work with the activations and do some (many) calculations (like 240000) this can´t do the trick.
is there a way to speed up things?
thank you
The text was updated successfully, but these errors were encountered: