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
I can use visualize_cam without any problem but I get the following error for the _saliency and _activation methods. Error:
InvalidArgumentError Traceback (most recent call last)
in ()
10
11 #img = visualize_activation(model, layer_idx, filter_indices=class_idx)
---> 12 img = visualize_saliency(model, layer_idx, filter_indices=class_idx, seed_input=X_test[idx])
13
14 plt.plot(img[..., 0].squeeze())
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in call(self, inputs)
2659 return self._legacy_call(inputs)
2660
-> 2661 return self._call(inputs)
2662 else:
2663 if py_any(is_tensor(x) for x in inputs):
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in _make_callable(self, feed_arrays, feed_symbols, symbol_vals, session)
2580 callable_opts.target.append(self.updates_op.name)
2581 # Create callable.
-> 2582 callable_fn = session._make_callable_from_options(callable_opts)
2583 # Cache parameters corresponding to the generated callable, so that
2584 # we can detect future mismatches and refresh the callable.
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py in exit(self, type_arg, value_arg, traceback_arg)
517 None, None,
518 compat.as_text(c_api.TF_Message(self.status.status)),
--> 519 c_api.TF_GetCode(self.status.status))
520 # Delete the underlying status object from memory otherwise it stays alive
521 # as there is a reference to status from this from the traceback due to
InvalidArgumentError: conv2d_9_input_11:0 is both fed and fetched.
The text was updated successfully, but these errors were encountered:
I have also tried the template code on github and got the same error. By the way, I have installed the keras-vis few days ago I don't think I am using an older version.
Hi, everyone this issue literally takes my two days since I'm quite new to the python&keras&tf despite having some coding background. For the time being just downgrade your tensorflow to the 1.7.1 if you're using the last verified one which is 1.8.0.
So, I'm closing this issue and creating new one about the versions.
I can use visualize_cam without any problem but I get the following error for the _saliency and _activation methods.
Error:
InvalidArgumentError Traceback (most recent call last)
in ()
10
11 #img = visualize_activation(model, layer_idx, filter_indices=class_idx)
---> 12 img = visualize_saliency(model, layer_idx, filter_indices=class_idx, seed_input=X_test[idx])
13
14 plt.plot(img[..., 0].squeeze())
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/vis/visualization/saliency.py in visualize_saliency(model, layer_idx, filter_indices, seed_input, backprop_modifier, grad_modifier)
123 (ActivationMaximization(model.layers[layer_idx], filter_indices), -1)
124 ]
--> 125 return visualize_saliency_with_losses(model.input, losses, seed_input, grad_modifier)
126
127
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/vis/visualization/saliency.py in visualize_saliency_with_losses(input_tensor, losses, seed_input, grad_modifier)
71 """
72 opt = Optimizer(input_tensor, losses, norm_grads=False)
---> 73 grads = opt.minimize(seed_input=seed_input, max_iter=1, grad_modifier=grad_modifier, verbose=False)[1]
74
75 channel_idx = 1 if K.image_data_format() == 'channels_first' else -1
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/vis/optimizer.py in minimize(self, seed_input, max_iter, input_modifiers, grad_modifier, callbacks, verbose)
141
142 # 0 learning phase for 'test'
--> 143 computed_values = self.compute_fn([seed_input, 0])
144 losses = computed_values[:len(self.loss_names)]
145 named_losses = zip(self.loss_names, losses)
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in call(self, inputs)
2659 return self._legacy_call(inputs)
2660
-> 2661 return self._call(inputs)
2662 else:
2663 if py_any(is_tensor(x) for x in inputs):
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in _call(self, inputs)
2628 feed_symbols,
2629 symbol_vals,
-> 2630 session)
2631 fetched = self._callable_fn(*array_vals)
2632 return fetched[:len(self.outputs)]
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in _make_callable(self, feed_arrays, feed_symbols, symbol_vals, session)
2580 callable_opts.target.append(self.updates_op.name)
2581 # Create callable.
-> 2582 callable_fn = session._make_callable_from_options(callable_opts)
2583 # Cache parameters corresponding to the generated callable, so that
2584 # we can detect future mismatches and refresh the callable.
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/tensorflow/python/client/session.py in _make_callable_from_options(self, callable_options)
1478 """
1479 self._extend_graph()
-> 1480 return BaseSession._Callable(self, callable_options)
1481
1482
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/tensorflow/python/client/session.py in init(self, session, callable_options)
1439 else:
1440 self._handle = tf_session.TF_DeprecatedSessionMakeCallable(
-> 1441 session._session, options_ptr, status)
1442 finally:
1443 tf_session.TF_DeleteBuffer(options_ptr)
~/anaconda3/envs/my_ktf/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py in exit(self, type_arg, value_arg, traceback_arg)
517 None, None,
518 compat.as_text(c_api.TF_Message(self.status.status)),
--> 519 c_api.TF_GetCode(self.status.status))
520 # Delete the underlying status object from memory otherwise it stays alive
521 # as there is a reference to status from this from the traceback due to
InvalidArgumentError: conv2d_9_input_11:0 is both fed and fetched.
The text was updated successfully, but these errors were encountered: