Tensorflowinferenceinterface: Mobilenet For Imagenet : Java.io.ioexception: Not A Valid Tensorflow Graph Serialization
I am trying to run mobilenet model trained over imagenet on Android Tensorflow for object recognition and facing the issue as described below. TensorFlowInferenceInterface: Failed
Solution 1:
The above issue has been resolved by updating the "libandroid_tensorflow_inference_java.jar" and "libtensorflow_inference.so" to the latest version i.e. Tensorflow - 1.4. The latest ".jar" and ".so" files can be found here.
The issue was due to mismatch of Tensorflow versions. Mobilenet classifier trained over ImageNet was built on Tensorflow - 1.3 and was being used for inference on Android with Tensorflow - 1.1.
Solution 2:
It says here in main activity java file
privatestaticfinalStringMODEL_FILE="file:///android_asset/expert-graph.pb";
privatestaticfinalStringLABEL_FILE="file:///android_asset/labels.txt";
Where your model files seems to be "mobilenet_imagenet.pb". After you make sure your model and labels name match for the project file here, change the input size what you trained on.(retrain.py file maybe has this information.)
privatestaticfinalintINPUT_SIZE=160;//privatestaticfinalintIMAGE_MEAN=128;
privatestaticfinalfloatIMAGE_STD=128;
privatestaticfinalStringOUTPUT_NAME="final_result";
Post a Comment for "Tensorflowinferenceinterface: Mobilenet For Imagenet : Java.io.ioexception: Not A Valid Tensorflow Graph Serialization"