keras-grad-cam
keras-grad-cam copied to clipboard
Can this be problem Specific?
Does this implementation only work with ImageNet like images or can it be tuned to your specific problem?
It can be tuned to your specific problem. As long as you can specify a target cost function, you can use this. I used this for visualizing the PilotNet network that outputs angles. This network is used for regression and not classification. https://jacobgil.github.io/deeplearning/vehicle-steering-angle-visualizations
InvalidArgumentError Traceback (most recent call last) /home/pardha/anaconda3/envs/for_tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args) 1326 try: -> 1327 return fn(*args) 1328 except errors.OpError as e:
/home/pardha/anaconda3/envs/for_tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py in _run_fn(session, feed_dict, fetch_list, target_list, options, run_metadata) 1305 feed_dict, fetch_list, target_list, -> 1306 status, run_metadata) 1307
/home/pardha/anaconda3/envs/for_tensorflow/lib/python3.6/contextlib.py in exit(self, type, value, traceback) 88 try: ---> 89 next(self.gen) 90 except StopIteration:
/home/pardha/anaconda3/envs/for_tensorflow/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py in raise_exception_on_not_ok_status() 465 compat.as_text(pywrap_tensorflow.TF_Message(status)), --> 466 pywrap_tensorflow.TF_GetCode(status)) 467 finally:
InvalidArgumentError: You must feed a value for placeholder tensor 'batch_normalization_1/keras_learning_phase' with dtype bool
[[Node: batch_normalization_1/keras_learning_phase = Placeholderdtype=DT_BOOL, shape=
During handling of the above exception, another exception occurred:
InvalidArgumentError Traceback (most recent call last)
/home/pardha/anaconda3/envs/for_tensorflow/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in call(self, inputs) 2266 updated = session.run(self.outputs + [self.updates_op], 2267 feed_dict=feed_dict, -> 2268 **self.session_kwargs) 2269 return updated[:len(self.outputs)] 2270
/home/pardha/anaconda3/envs/for_tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py in run(self, fetches, feed_dict, options, run_metadata) 893 try: 894 result = self._run(None, fetches, feed_dict, options_ptr, --> 895 run_metadata_ptr) 896 if run_metadata: 897 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
/home/pardha/anaconda3/envs/for_tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py in _run(self, handle, fetches, feed_dict, options, run_metadata) 1122 if final_fetches or final_targets or (handle and feed_dict_tensor): 1123 results = self._do_run(handle, final_targets, final_fetches, -> 1124 feed_dict_tensor, options, run_metadata) 1125 else: 1126 results = []
/home/pardha/anaconda3/envs/for_tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py in _do_run(self, handle, target_list, fetch_list, feed_dict, options, run_metadata) 1319 if handle is None: 1320 return self._do_call(_run_fn, self._session, feeds, fetches, targets, -> 1321 options, run_metadata) 1322 else: 1323 return self._do_call(_prun_fn, self._session, handle, feeds, fetches)
/home/pardha/anaconda3/envs/for_tensorflow/lib/python3.6/site-packages/tensorflow/python/client/session.py in _do_call(self, fn, *args) 1338 except KeyError: 1339 pass -> 1340 raise type(e)(node_def, op, message) 1341 1342 def _extend_graph(self):
InvalidArgumentError: You must feed a value for placeholder tensor 'batch_normalization_1/keras_learning_phase' with dtype bool
[[Node: batch_normalization_1/keras_learning_phase = Placeholderdtype=DT_BOOL, shape=