0

I have a TFLite model. The model input is a 256x192 image, it is quantized to 16 bit. It was quantized with this converter:

converter.optimizations = [tf.lite.Optimize.DEFAULT]
converter.target_spec.supported_types = [tf.float16]
tflite_model = converter.convert()

I am trying to load it in my android app, and faces the following problem, while executing tflite = new Interpreter(tfliteModel, tfliteOptions);:

E/AndroidRuntime: FATAL EXCEPTION: CameraBackground
    Process: android.example.com.tflitecamerademo, PID: 7943
    java.lang.IllegalArgumentException: Internal error: Cannot create interpreter: Unimplemented data type FLOAT16 (1) in tensor
    Unimplemented data type FLOAT16 (1) in tensor

What can I try in order to solve it?

Thanks

jonb
  • 845
  • 1
  • 13
  • 36

1 Answers1

0

EDIT: Looks like you should use tf.float16 starting tf 2 https://www.tensorflow.org/lite/convert/1x_compatibility#unsupported_apis

May be file an issue on github

Karim Nosseir
  • 540
  • 2
  • 8