Skip to content

Commit

Permalink
Fix visualize activations (matterport#1211)
Browse files Browse the repository at this point in the history
Fix visualize activations (Squashed 4 commits by @keineahnung2345)

# Get activations of a few sample layers
activations = model.run_graph([image], [
    ("input_image",        model.keras_model.get_layer("input_image").output)
])
leads to the error:
InvalidArgumentError: input_image:0 is both fed and fetched.

Revise the code according to https://stackoverflow.com/questions/39307108/placeholder-20-is-both-fed-and-fetched
  • Loading branch information
keineahnung2345 authored and waleedka committed Jan 22, 2019
1 parent 1f99e1f commit aa49e91
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion samples/balloon/inspect_balloon_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@
"source": [
"# Get activations of a few sample layers\n",
"activations = model.run_graph([image], [\n",
" (\"input_image\", model.keras_model.get_layer(\"input_image\").output),\n",
" (\"input_image\", tf.identity(model.keras_model.get_layer(\"input_image\").output)),\n",
" (\"res2c_out\", model.keras_model.get_layer(\"res2c_out\").output),\n",
" (\"res3c_out\", model.keras_model.get_layer(\"res3c_out\").output),\n",
" (\"res4w_out\", model.keras_model.get_layer(\"res4w_out\").output), # for resnet100\n",
Expand Down
2 changes: 1 addition & 1 deletion samples/coco/inspect_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@
"source": [
"# Get activations of a few sample layers\n",
"activations = model.run_graph([image], [\n",
" (\"input_image\", model.keras_model.get_layer(\"input_image\").output),\n",
" (\"input_image\", tf.identity(model.keras_model.get_layer(\"input_image\").output)),\n",
" (\"res4w_out\", model.keras_model.get_layer(\"res4w_out\").output), # for resnet100\n",
" (\"rpn_bbox\", model.keras_model.get_layer(\"rpn_bbox\").output),\n",
" (\"roi\", model.keras_model.get_layer(\"ROI\").output),\n",
Expand Down
2 changes: 1 addition & 1 deletion samples/nucleus/inspect_nucleus_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@
"source": [
"# Get activations of a few sample layers\n",
"activations = model.run_graph([image], [\n",
" (\"input_image\", model.keras_model.get_layer(\"input_image\").output),\n",
" (\"input_image\", tf.identity(model.keras_model.get_layer(\"input_image\").output)),\n",
" (\"res2c_out\", model.keras_model.get_layer(\"res2c_out\").output),\n",
" (\"res3c_out\", model.keras_model.get_layer(\"res3c_out\").output),\n",
" (\"rpn_bbox\", model.keras_model.get_layer(\"rpn_bbox\").output),\n",
Expand Down

0 comments on commit aa49e91

Please sign in to comment.