Description
I am trying to write a FiJi plugin in java. I have trained models in Python Tensorflow Version 2.2.0. However, when I try to perform prediction in Java I have the following problem:
`test_images\test_00001.png
28-28
1
4
inputTensor is: FLOAT tensor with shape [1, 28, 28, 1]
FLOAT
1.15.0
2021-03-21 18:12:47.782329: I tensorflow/cc/saved_model/reader.cc:31] Reading SavedModel from: CreateModelWithPythonTensorflow/model
2021-03-21 18:12:48.073847: I tensorflow/cc/saved_model/reader.cc:54] Reading meta graph with tags { serve }
2021-03-21 18:12:48.079446: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2021-03-21 18:12:48.110611: I tensorflow/cc/saved_model/loader.cc:202] Restoring SavedModel bundle.
2021-03-21 18:12:48.294807: I tensorflow/cc/saved_model/loader.cc:151] Running initialization op on SavedModel bundle at path: CreateModelWithPythonTensorflow/model
2021-03-21 18:12:48.316435: I tensorflow/cc/saved_model/loader.cc:311] SavedModel load for tags { serve }; Status: success. Took 534069 microseconds.
predicting...
Exception in thread "main" java.lang.IllegalArgumentException: DataType 20 is not recognized in Java (version 1.15.0)
at org.tensorflow.DataType.fromC(DataType.java:85)
at org.tensorflow.Tensor.fromHandle(Tensor.java:540)
at org.tensorflow.Session$Runner.runHelper(Session.java:343)
at org.tensorflow.Session$Runner.run(Session.java:276)
at TfDataTypeIssue.main(TfDataTypeIssue.java:43)`
The full code can be found on similar issues (#41212 (tensorflow/tensorflow#41212) or #1079 (xamarin/XamarinComponents#1079) or in this file ReportProblem.zip
. I used to get a trained model in Python in CreateModelWithPythonTensorflow and Java Maven Project when run gives the above error.