Android 如何在tflite模型上应用元数据?
我正在尝试使用自定义模型启动TF Object detection Android应用程序() 我需要解决这个问题Android 如何在tflite模型上应用元数据?,android,tensorflow-lite,object-detection-api,Android,Tensorflow Lite,Object Detection Api,我正在尝试使用自定义模型启动TF Object detection Android应用程序() 我需要解决这个问题 java.lang.AssertionError: Error occurred when initializing ObjectDetector: Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to preprocess input images
java.lang.AssertionError: Error occurred when initializing ObjectDetector: Input tensor has type kTfLiteFloat32: it requires specifying NormalizationOptions metadata to preprocess input images.
我发现一个建议,我需要在.tflite模型上应用元数据,所以我尝试运行
python tflite_convert.py \ --input_shapes="1,300,300,3" \ --input_arrays=normalized_input_image_tensor \ --output_arrays="TFLite_Detection_PostProcess,TFLite_Detection_PostProcess:1,TFLite_Detection_PostProcess:2,TFLite_Detection_PostProcess:3" \ --allow_custom_ops \ --saved_model_dir=alexey/saved_model \ --inference_input_type=FLOAT \ --inference_type=FLOAT \ --output_file=detect.tflite
它是在没有任何错误的情况下完成的,但是当我使用这个生成的.tflite启动应用程序时,我得到了与不应用元数据时相同的错误。
所以在我看来,元数据并没有被应用参考文档。