{"action":"created","issue":{"url":"https://api.github.com/repos/tensorflow/models/issues/2136","repository_url":"https://api.github.com/repos/tensorflow/models","labels_url":"https://api.github.com/repos/tensorflow/models/issues/2136/labels{/name}","comments_url":"https://api.github.com/repos/tensorflow/models/issues/2136/comments","events_url":"https://api.github.com/repos/tensorflow/models/issues/2136/events","html_url":"https://github.com/tensorflow/models/issues/2136","id":248184284,"node_id":"MDU6SXNzdWUyNDgxODQyODQ=","number":2136,"title":"add new input in object_detection and forward it as output","user":{"login":"joergkiesewetter","id":9930269,"node_id":"MDQ6VXNlcjk5MzAyNjk=","avatar_url":"https://avatars0.githubusercontent.com/u/9930269?v=4","gravatar_id":"","url":"https://api.github.com/users/joergkiesewetter","html_url":"https://github.com/joergkiesewetter","followers_url":"https://api.github.com/users/joergkiesewetter/followers","following_url":"https://api.github.com/users/joergkiesewetter/following{/other_user}","gists_url":"https://api.github.com/users/joergkiesewetter/gists{/gist_id}","starred_url":"https://api.github.com/users/joergkiesewetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joergkiesewetter/subscriptions","organizations_url":"https://api.github.com/users/joergkiesewetter/orgs","repos_url":"https://api.github.com/users/joergkiesewetter/repos","events_url":"https://api.github.com/users/joergkiesewetter/events{/privacy}","received_events_url":"https://api.github.com/users/joergkiesewetter/received_events","type":"User","site_admin":false},"labels":[{"id":421482076,"node_id":"MDU6TGFiZWw0MjE0ODIwNzY=","url":"https://api.github.com/repos/tensorflow/models/labels/stat:awaiting%20tensorflower","name":"stat:awaiting tensorflower","color":"b60205","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-08-05T13:06:00Z","updated_at":"2018-11-01T14:15:51Z","closed_at":"2018-11-01T14:15:51Z","author_association":"NONE","body":"### System information\r\n- **What is the top-level directory of the model you are using**: object_detection\r\n- **Have I written custom code (as opposed to using a stock example script provided in TensorFlow)**: yes\r\n- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Windows 10\r\n- **TensorFlow installed from (source or binary)**: binary\r\n- **TensorFlow version (use command below)**: 1.2\r\n- **Exact command to reproduce**:\r\n\r\nAfter batch prediction is possible, now, I wanted to extend the exporter in object_detection to have an additional input called 'key'. In the output I just wanted to show the 'key' tensor to match a particular result to a given input. \r\n\r\nI enhanced the `placeholder_tensor` in `_export_inference_graph` to support a list of multiple inputs:\r\n\r\n```placeholder_tensor = {}\r\nplaceholder_tensor[input_type], input_tensors = input_placeholder_fn_map[input_type]()\r\n placeholder_tensor['key'] = tf.placeholder(\r\n      tf.int64, shape=[None], name='key')\r\n```\r\n\r\nin `_add_output_tensor_nodes`,  I added the output definition:\r\n\r\n`outputs['key'] = tf.identity(key_tensor, name='key')`\r\n\r\nin _write_saved_model, I changed:\r\n\r\n```      tensor_info_inputs = {\r\n          'inputs': tf.saved_model.utils.build_tensor_info(inputs[input_type]),\r\n          'key': tf.saved_model.utils.build_tensor_info(inputs['key'])}\r\n```\r\n\r\nwith some additional changes to make everything work, I finally was able to export the model. Unfortunately, it is still not working because the name of the output tensor changes during the build. The output from the saved_model_cli is:\r\n\r\n```signature_def['serving_default']:\r\nThe given SavedModel SignatureDef contains the following input(s):\r\ninputs['inputs'] tensor_info:\r\n    dtype: DT_UINT8\r\n    shape: (-1, -1, -1, 3)\r\n    name: image_tensor:0\r\ninputs['key'] tensor_info:\r\n    dtype: DT_STRING\r\n    shape: (-1)\r\n    name: key:0\r\nThe given SavedModel SignatureDef contains the following output(s):\r\noutputs['detection_boxes'] tensor_info:\r\n    dtype: DT_FLOAT\r\n    shape: (-1, 300, 4)\r\n    name: detection_boxes:0\r\noutputs['detection_classes'] tensor_info:\r\n    dtype: DT_FLOAT\r\n    shape: (-1, 300)\r\n    name: detection_classes:0\r\noutputs['detection_scores'] tensor_info:\r\n    dtype: DT_FLOAT\r\n    shape: (-1, 300)\r\n    name: detection_scores:0\r\noutputs['key'] tensor_info:\r\n    dtype: DT_STRING\r\n    shape: (-1)\r\n    name: key_1:0\r\noutputs['num_detections'] tensor_info:\r\n    dtype: DT_FLOAT\r\n    shape: (-1)\r\n    name: num_detections:0\r\nMethod name is: tensorflow/serving/predict\r\n```\r\n\r\nAs you can see, the name for the output tensor is `key_1` and not `key`. It seems like the system added the `_1` with a reason. \r\n\r\nDoes anyone has a solution to this?"},"comment":{"url":"https://api.github.com/repos/tensorflow/models/issues/comments/435053826","html_url":"https://github.com/tensorflow/models/issues/2136#issuecomment-435053826","issue_url":"https://api.github.com/repos/tensorflow/models/issues/2136","id":435053826,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTA1MzgyNg==","user":{"login":"wt-huang","id":42785337,"node_id":"MDQ6VXNlcjQyNzg1MzM3","avatar_url":"https://avatars0.githubusercontent.com/u/42785337?v=4","gravatar_id":"","url":"https://api.github.com/users/wt-huang","html_url":"https://github.com/wt-huang","followers_url":"https://api.github.com/users/wt-huang/followers","following_url":"https://api.github.com/users/wt-huang/following{/other_user}","gists_url":"https://api.github.com/users/wt-huang/gists{/gist_id}","starred_url":"https://api.github.com/users/wt-huang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wt-huang/subscriptions","organizations_url":"https://api.github.com/users/wt-huang/orgs","repos_url":"https://api.github.com/users/wt-huang/repos","events_url":"https://api.github.com/users/wt-huang/events{/privacy}","received_events_url":"https://api.github.com/users/wt-huang/received_events","type":"User","site_admin":false},"created_at":"2018-11-01T14:15:51Z","updated_at":"2018-11-01T14:15:51Z","author_association":"NONE","body":"Closing as this is resolved"}}
{"actor":{"display_login":"wt-huang"}}