Closed benjaminbergner closed 6 years ago
Check the following issue, https://github.com/raghakot/keras-vis/issues/116
Hi, guys.
I created PR( #120 ) so please refer to it. And... , please merge it soon and release a new version. :-)
This problem also occurred in Tensorflow-1.9.0. With PR( #120 ) applied, no problems occurred with Tensorflow-1.9.0.
I met the same error, how you fix that thanks
@AlexanderZhujiageng , Please refer to the diff below.
https://github.com/raghakot/keras-vis/pull/120/files/74f2d086feb9556cbb2f1cfd90d6d4f8c21f520d
@keisen's PR should have fixed this.
I am getting this error with tf r1.10
@wookoouk , This patch is not released to PyPi yet. So, You have to directly install keras-vis from the currently master branch as follows .
pip install git+https://github.com/raghakot/keras-vis.git
I had installed keras-vis by cloning it and running python setup.py install
I ran pip install git+https://github.com/raghakot/keras-vis.git
and still got:
Traceback (most recent call last):
File "index.py", line 112, in <module>
saliency_image = visualize_saliency(model, layer_idx, [pred_class], seed_img)
File "/usr/local/lib/python2.7/site-packages/vis/visualization/saliency.py", line 125, in visualize_saliency
return visualize_saliency_with_losses(model.input, losses, seed_input, grad_modifier)
File "/usr/local/lib/python2.7/site-packages/vis/visualization/saliency.py", line 73, in visualize_saliency_with_losses
grads = opt.minimize(seed_input=seed_input, max_iter=1, grad_modifier=grad_modifier, verbose=False)[1]
File "/usr/local/lib/python2.7/site-packages/vis/optimizer.py", line 143, in minimize
computed_values = self.compute_fn([seed_input, 0])
File "/usr/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 2666, in __call__
return self._call(inputs)
File "/usr/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 2635, in _call
session)
File "/usr/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 2587, in _make_callable
callable_fn = session._make_callable_from_options(callable_opts)
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1414, in _make_callable_from_options
return BaseSession._Callable(self, callable_options)
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1368, in __init__
session._session, options_ptr, status)
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/errors_impl.py", line 519, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: conv2d_1_input:0 is both fed and fetched.
Exception tensorflow.python.framework.errors_impl.InvalidArgumentError: InvalidArgumentError() in <bound method _Callable.__del__ of <tensorflow.python.client.session._Callable object at 0x12cf329d0>> ignored
I am running some tests to make sure it is not a result of something in my code and will let you know
I noticed that your situation seems to be the same as below . https://github.com/raghakot/keras-vis/issues/127#issuecomment-415620894
I manually deleted keras-vis and installed it again with ip install git+https://github.com/raghakot/keras-vis.git --upgrade
and it is all good now :)
Thank you
latest version from git works for me! :+1: do you know when they plan to make a new release? thanks.
@keisen. I used you command: 'pip install git+https://github.com/raghakot/keras-vis.git' 'pip install git+https://github.com/raghakot/keras-vis.git --upgrade'
but somehow it keep install 0.4.1. could you share you tf and keras version. Mine is: tensorflow: 1.13 keras: 2.2.4 keras-vis: 0.4.1
@phylliskaka i was running into same issue. this is a work around: https://stackoverflow.com/a/55418198
@mandarup that workaround also worked for me, thank you.
That's the beginning of the normal Maximal Activations example. It gives the error: InvalidArgumentError: conv2d_1_input_1:0 is both fed and fetched.
What could be a solution for this?
[x ] Check that you are up-to-date with the master branch of keras-vis. You can update with: pip install git+git://github.com/raghakot/keras-vis.git --upgrade --no-deps
[x ] If running on TensorFlow, check that you are up-to-date with the latest version. The installation instructions can be found here.
[ ] If running on Theano, check that you are up-to-date with the master branch of Theano. You can update with: pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
[x ] Provide a link to a GitHub Gist of a Python script that can reproduce your issue (or just copy the script here if it is short).