提交 6fe7db7f 编写于 作者: keineahnung2345's avatar keineahnung2345 提交者: Waleed

Fix visualize activations (#1211)

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
上级 a0a2aa00
......@@ -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",
......@@ -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",
......@@ -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",
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册