Skip to content

Error to run on tensorflow model #3

@msarfrazcss

Description

@msarfrazcss

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:

(https://github.com/EdjeElectronics/TensorFlow-Object-Detection-API-Tutorial-Train-Multiple-Objects-Windows-10/tree/d1c5b59803543e48362c27c48d704d4b0d92d135)

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)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions