-
Notifications
You must be signed in to change notification settings - Fork 30
Description
This code (https://sites.google.com/view/tensorflow-example-java-api) is running successfully on YOLOv2 model, but not runs on my tensorflow model which I have trained by using python tutorial:
That produce .pb file for object detection, when i run this code on this trained model it gives error at the line:
Tensor result = session.runner().feed("input", image).fetch("output").run().get(0).expect(Float.class)) {
ERROR:
Exception in thread "main" java.lang.IllegalArgumentException: In[0] is not a matrix. Instead it has shape [1,416,416,3]
[[{{node MatMul}} = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_input_0_0, W)]]
at org.tensorflow.Session.run(Native Method)
at org.tensorflow.Session.access$100(Session.java:48)
at org.tensorflow.Session$Runner.runHelper(Session.java:314)
at org.tensorflow.Session$Runner.run(Session.java:264)
at com.tensorflow.ObjectDetector.executeYOLOGraph(ObjectDetector.java:91)
at com.tensorflow.ObjectDetector.detect(ObjectDetector.java:49)
at com.tensorflow.Main.main(Main.java:9)