tensorflow / tensorflow/tflite-support

Ultralytics Request for TFLite Support Python 3.12+ Wheels

Open
#998 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
441
Forks
146
PR merge metrics
No merged PRs in 30d

Description

Bug Report: Request for TFLite Support Python 3.12+ Wheels

Description

We're experiencing issues with the tflite-support package in Python 3.12+ environments due to the lack of pre-built wheels for newer Python versions. Though the compatibility issues with the deprecated imp module have been fixed in version 0.4.4, pip is installing older incompatible versions (0.1.0a1) when attempting to install in Python 3.12 environments because no wheels are available.

Error Details

When pip installs the older version in Python 3.12, we get the following error:

ModuleNotFoundError: No module named 'imp'

This is because older versions still use the imp module in /tflite_support/flatbuffers/compat.py:19, which was deprecated in Python 3.4 and removed entirely in Python 3.12.

Reproduction Steps

  1. Install Python 3.12
  2. Run pip install tflite-support
  3. Attempt to import the package with from tflite_support import metadata

Impact

This issue is blocking Ultralytics from supporting Python 3.12+. In our CI tests, model export to TFLite format fails because the metadata module can't be imported correctly. As Python 3.12 is becoming more widely adopted (and Python 3.13 is on the horizon), this will affect many projects that depend on TFLite with metadata support.
https://github.com/ultralytics/ultralytics/pull/16413

CC @ultralytics/yolo-team

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with Python 3.12 using pip install tflite-support, then import metadata as described. Inspect /tflite_support/flatbuffers/compat.py:19 and the package's wheel or release configuration to determine why an older version is selected. Done means a supported tflite-support version installs on Python 3.12+ and the metadata import succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.