tensorflow-onnx icon indicating copy to clipboard operation
tensorflow-onnx copied to clipboard

Error loading oidv2-resnet_v1_101.ckpt after converting to tflite

Open creativesh opened this issue 2 years ago • 2 comments

Hi ,

I got oidv2-resnet_v1_101.ckpt from https://storage.googleapis.com/openimages/web/extras.html and convert it to tflite with this code :

SAVED_MODEL_DIR='saved_model1/' converter = tf.lite.TFLiteConverter.from_saved_model( saved_model_dir=SAVED_MODEL_DIR) converter.optimizations = {tf.lite.Optimize.DEFAULT} #optional sh converter.change_concat_input_ranges = True #optional sh converter.target_spec.supported_ops = [ #should be tf.lite.OpsSet.TFLITE_BUILTINS, # enable TensorFlow Lite ops. tf.lite.OpsSet.SELECT_TF_OPS # enable TensorFlow ops. ] tflite_model = converter.convert() open("new1.tflite", "wb").write(tflite_model)

it was converted successfully and I could load it with python interpreter and get valid results.

However, when I want to load the file in android it is not loaded with this error:

screen

apparently the problem is with model input type :

nepton_tagging

How can I fix it ?

creativesh avatar Sep 04 '22 13:09 creativesh

Could you please share me the exact download url of oidv2-resnet_v1_101.ckpt so I could do a local debug?

fatcat-z avatar Sep 04 '22 13:09 fatcat-z

@fatcat-z

yes, this is the link of the model checkpoint:

https://storage.googleapis.com/openimages/2017_07/oidv2-resnet_v1_101.ckpt.tar.gz

and the other necessary items are in the page : https://storage.googleapis.com/openimages/web/extras.html

creativesh avatar Sep 06 '22 05:09 creativesh

Looks like I missed something before. If you are trying to convert a tf model to tflite, probably this issue should be opened under tensorflow repo. Tf2onnx focuses on converting a tf model or tflite model to ONNX.

fatcat-z avatar Oct 11 '22 12:10 fatcat-z