right after executing this:
# Get activations of a few sample layers
activations = model.run_graph([image], [
("input_image", model.keras_model.get_layer("input_image").output),
("res4w_out", model.keras_model.get_layer("res4w_out").output), # for resnet100
("rpn_bbox", model.keras_model.get_layer("rpn_bbox").output),
("roi", model.keras_model.get_layer("ROI").output),
])
I'm getting this error-chain:
InvalidArgumentError Traceback (most recent call last)
4 ("res4w_out", model.keras_model.get_layer("res4w_out").output), # for resnet100
5 ("rpn_bbox", model.keras_model.get_layer("rpn_bbox").output),
----> 6 ("roi", model.keras_model.get_layer("ROI").output),
7 ])
~/Mask_RCNN/mrcnn/model.py in run_graph(self, images, outputs, image_metas)
2710 if model.uses_learning_phase and not isinstance(K.learning_phase(), int):
2711 model_in.append(0.)
-> 2712 outputs_np = kf(model_in)
2713
2714 # Pack the generated Numpy arrays into a a dict and log the results.
/usr/local/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in __call__(self, inputs)
2664 return self._legacy_call(inputs)
2665
-> 2666 return self._call(inputs)
2667 else:
2668 if py_any(is_tensor(x) for x in inputs):
/usr/local/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in _call(self, inputs)
2633 feed_symbols,
2634 symbol_vals,
-> 2635 session)
2636 fetched = self._callable_fn(*array_vals)
2637 return fetched[:len(self.outputs)]
/usr/local/anaconda3/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py in _make_callable(self, feed_arrays, feed_symbols, symbol_vals, session)
2585 callable_opts.target.append(self.updates_op.name)
2586 # Create callable.
-> 2587 callable_fn = session._make_callable_from_options(callable_opts)
2588 # Cache parameters corresponding to the generated callable, so that
2589 # we can detect future mismatches and refresh the callable.
/usr/local/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py in _make_callable_from_options(self, callable_options)
1469 """
1470 self._extend_graph()
-> 1471 return BaseSession._Callable(self, callable_options)
1472
1473
/usr/local/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py in __init__(self, session, callable_options)
1423 with errors.raise_exception_on_not_ok_status() as status:
1424 self._handle = tf_session.TF_SessionMakeCallable(
-> 1425 session._session, options_ptr, status)
1426 finally:
1427 tf_session.TF_DeleteBuffer(options_ptr)
/usr/local/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py in __exit__(self, type_arg, value_arg, traceback_arg)
526 None, None,
527 compat.as_text(c_api.TF_Message(self.status.status)),
--> 528 c_api.TF_GetCode(self.status.status))
529 # Delete the underlying status object from memory otherwise it stays alive
530 # as there is a reference to status from this from the traceback due to
InvalidArgumentError: input_image:0 is both fed and fetched.
I looked around and found that latest keras-vis version and a tf version higher than 1.8 is needed to solve similar problems.
so I upgraded my tf to 1.12 , and installed keras-vis 0.4.1 - yet it keeps appearing
appreciate some help \m/
The second line in
activations = model.run_graph([image], [
("input_image", model.keras_model.get_layer("input_image").output),
("res4w_out", model.keras_model.get_layer("res4w_out").output), # for resnet100
("rpn_bbox", model.keras_model.get_layer("rpn_bbox").output),
("roi", model.keras_model.get_layer("ROI").output),
])
gives you the error, try comment it out.
@keineahnung2345
yeah I tried it the other day too, but the exception remains the same :/
@AsherYartsevTech Have you restarted your kernel before commenting ("input_image", model.keras_model.get_layer("input_image").output), and then running that cell?
I had the same problem, and downgrading tensorflow to 1.5.0 fixes it.
yeah the downgrading works!
Most helpful comment
I had the same problem, and downgrading tensorflow to 1.5.0 fixes it.