Open leszekmp opened 4 years ago
Hi @leszekmp,
I can run the entire notebook if I try it with
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
What is your tensorflow version? I am using tensorflow==2.2.0
I'm also using tensorflow 2.2.0.
Could you share more code that you put into your notebook? I'm not sure what's the issue as the notebook works for me when eager execution is disabled.
I think the error is related to the "weights" variable (mean of all the gradients for each activation map) https://github.com/TeamHG-Memex/eli5/blob/master/eli5/keras/gradcam.py#L120. You can search the notebook for 1280
and you'll see that the model has layers with 1280 activation maps near the end of it.
Copying and pasting the code from the tutorial into a notebook. Works fine through the "#check the top 5 indices" section. In the next section, "eli5.show_prediction(model, doc)" code results in the following error:
RuntimeError: tf.gradients is not supported when eager execution is enabled. Use tf.GradientTape instead.
Tried adding the following two lines:
import tensorflow as tf tf.compat.v1.disable_eager_execution()
Error changes to:
ValueError: Tensor Tensor("Mean:0", shape=(None, 1280), dtype=float32) is not an element of this graph.
Help?!