-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapt to TFJava 0.5.0 #29
base: master
Are you sure you want to change the base?
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
@@ -269,7 +265,9 @@ public static void main(String[] params) { | |||
//The given SavedModel SignatureDef input | |||
feedDict.put("input_tensor", reshapeTensor); | |||
//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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change means the output of the model is discarded, please revert it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This result needs to be in a try with resources so that all the outputs are closed.
cc #28 article 3