Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
...w-examples/src/main/java/org/tensorflow/model/examples/cnn/fastrcnn/FasterRcnnInception.java
Outdated
Show resolved
Hide resolved
| //The given SavedModel MetaGraphDef key | ||
| Map<String, Tensor> outputTensorMap = model.function("serving_default").call(feedDict); | ||
| Map<String, Tensor> outputTensorMap = new HashMap<>(); | ||
| model.function("serving_default").call(feedDict); |
There was a problem hiding this comment.
This change means the output of the model is discarded, please revert it.
There was a problem hiding this comment.
I roughly understand what you mean, but I'm not sure if this is correct. get(0) will return a tensor.
There was a problem hiding this comment.
Hi, @Craigacp Thank you for your timely response. Please help review and raise any issues that need to be revised
There was a problem hiding this comment.
It would just be easier to refactor the code to use the result object rather than the Map<String,Tensor>. You're only adding a single output to the map, but then inspecting it for lots of keys that aren't there.
...w-examples/src/main/java/org/tensorflow/model/examples/cnn/fastrcnn/FasterRcnnInception.java
Outdated
Show resolved
Hide resolved
| if (detectionScore > 0.3f) { | ||
| boxArray.add(detectionBoxes.get(0, n)); | ||
| } | ||
| Result result = model.function("serving_default").call(feedDict); |
There was a problem hiding this comment.
This result needs to be in a try with resources so that all the outputs are closed.
cc #28 article 3