3

tflite_support's task library is missing. I've install the tflite_support with pip install tflite-support. I've tried using help() function to get the pakage content with help(tflite_support) and got the output 'PACKAGE CONTENTS _pywrap_codegen _pywrap_flatbuffers codegen flatbuffers (package) metadata metadata_schema_py_generated schema_py_generated'. There is no task library inside like how the tflite website shows https://www.tensorflow.org/lite/inference_with_metadata/task_library/object_detector#run_inference_in_python. I get the same result doing it in my window pc. Am I doing anything wrong or the task library is just missing?

2 Answers2

1

A quick fix is to compile tflite-support with Python 3.9, 3.10, or 3.11 support by first downloading the published Mac or Ubuntu wheels: https://pypi.org/project/tflite-support-nightly/0.4.4.dev20230623/#files then running

pip install ./tflite_support_nightly-0.4.4.dev20230623-cp310-cp310-macosx_10_11_x86_64.whl 

Note: Change the pip install command to match the downloaded wheel.

Referenced from the following GitHub issue

In case the above link stops working you can use: https://pypi.org/project/tflite-support-nightly/#files Don't forget to change the commands to match the downloaded wheel.

Luv_Python
  • 194
  • 6
0

I'm using tflite-support 0.4.1 and it looks like the task module is not supported on Windows:


import flatbuffers
import platform

from tensorflow_lite_support.metadata import metadata_schema_py_generated
from tensorflow_lite_support.metadata import schema_py_generated
from tensorflow_lite_support.metadata.python import metadata
from tflite_support import metadata_writers

if platform.system() != 'Windows':
  # Task Library is not supported on Windows yet.
  from tflite_support import task

There's also a note about it in the task_library docs.

ANimator120
  • 2,556
  • 1
  • 20
  • 52