Giter VIP home page Giter VIP logo

Comments (6)

khanhlvg avatar khanhlvg commented on June 22, 2024 2

A temporary workaround could be to skip the import statement that causing the issue, and import the metadata_writer that you're using directly. We're looking into fixing the root cause.

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 tensorflow_lite_support.metadata.python import metadata_writers

from tflite-support.

ethanluoyc avatar ethanluoyc commented on June 22, 2024 1

@lu-wang-g I think this is due to the usage of the pybind11_abseil/status_casters.h. I think this is somehow due to the the usage of pybind11::google::ImportStatusModule() in this project as well as in TensorFlow and they are conflicting with each other.

The pybind side of issue that may be related is pybind/pybind11#439.

I am not entirely sure how to address this as I am less experience with C++..

from tflite-support.

lu-wang-g avatar lu-wang-g commented on June 22, 2024

May you try screening if StatusCode is used in any of your code and if you can use a different namespace for it?

from tflite-support.

glenn-jocher avatar glenn-jocher commented on June 22, 2024

@lu-wang-g the ultralytics package doesn't use any type called 'StatusCode', but checking other dependencies like onnx and tensorflow I see that it is a pretty common name.

But this seems unrelated to ultralytics as everything works correctly with tensorflow==2.13.1, this error only appears in tflite_support when used with tensorflow==2.14.0.

from tflite-support.

glenn-jocher avatar glenn-jocher commented on June 22, 2024

@lu-wang-g @ethanluoyc I just realized this error is very easily reproducible directly in Google Colab just by installing and attempting to import the package. If this package is not even usable in Google Colab this must raise some pretty serious red flags here no?

Are there any plans to resolve this and update the package?

Reproduce

!pip install tflite_support

import tflite_support

Result

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
[<ipython-input-2-10ee15e7e9a8>](https://localhost:8080/#) in <cell line: 1>()
----> 1 import tflite_support

4 frames
[/usr/local/lib/python3.10/dist-packages/tensorflow_lite_support/python/task/vision/core/tensor_image.py](https://localhost:8080/#) in <module>
     17 
     18 from tensorflow_lite_support.python.task.vision.core import color_space_type
---> 19 from tensorflow_lite_support.python.task.vision.core.pybinds import image_utils
     20 
     21 

ImportError: generic_type: cannot initialize type "StatusCode": an object with that name is already defined
Screenshot 2024-02-19 at 16 52 04

from tflite-support.

glenn-jocher avatar glenn-jocher commented on June 22, 2024

@khanhlvg we've implemented your solution, it works, and we have now successfully updated to the latest version of TF 2.16 for Ultralytics exports in ultralytics/ultralytics#13176

Thank you for the help!

from tflite-support.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.