Skip to content

Ultralytics Request for TFLite Support Python 3.12+ Wheels #998

@glenn-jocher

Description

@glenn-jocher

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.
ultralytics/ultralytics#16413

CC @ultralytics/yolo-team

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions