Comments (6)
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.
@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.
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.
@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.
@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
from tflite-support.
@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)
- I want to ask if TFLImage Searcher is supported on iOS and if so, where can I get a sample?
- Getting "Cannot copy to a TensorFlowLite tensor (serving_default_input_1:0) with 63984 bytes from a Java Buffer with 64000 bytes" error while attempting to pass the Input and Output TensorAudio Buffer to TFLite Interpreter for inference HOT 1
- ImportError from image_utils HOT 4
- Could you please provide a aarch64 tflite-support wheel for python 3.10 HOT 2
- How to read .wav in adroid jni?
- `tf.lite`, or `tflite_tuntime.interpreter as `tflite`?
- TensorFlowLiteTaskAudio for iOS: How to save audio and then play it
- ERROR: Could not find a version that satisfies the requirement tflite-support==0.4.4 HOT 4
- Installation Error: Unable to find installation candidates for tflite-support (0.4.4)
- Build TensorFlowLiteTaskVision_framework failed HOT 2
- How to handle dynamic output tensors with `tflite.runForMultipleInputsOutputs`
- iOS Error duplicate symbols HOT 2
- 0.4.2 and 0.4.3 versions of the pod are crashing on app launch on iOS 12.5.7
- Quantization with tflite : Unexpected input data type. Actual: (tensor(float)) , expected: (tensor(int8))
- How to install tflite_support in pip by source compiling HOT 3
- Possibility of channel-by-channel image normalization when adding metadata
- Document TFLite Support vs MediaPipe HOT 1
- No 0.4.4 PyPi package available for Arm/Python 3.11
- Model Loading Error for Image Embedder in Android
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tflite-support.