google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.4k stars 5.15k forks source link

Error: NOT_FOUND: Input tensor has type float32: it requires specifying NormalizationOptions metadata to preprocess input images.; Initialize was not ok; StartGraph failed #5583

Open wanggoldx opened 2 months ago

wanggoldx commented 2 months ago

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

None

OS Platform and Distribution

rock5b dibian

MediaPipe Tasks SDK version

No response

Task name (e.g. Image classification, Gesture recognition etc.)

Image classification

Programming Language and version (e.g. C++, Python, Java)

python

Describe the actual behavior

The error occured

Describe the expected behaviour

The model can run properly

Standalone code/steps you may have used to try to get what you need

When I plug the model into the code copy from this website https://colab.research.google.com/github/googlesamples/mediapipe/blob/main/examples/image_classification/python/image_classifier.ipynb
The error occured.
I have find many solution and known that I need to add the metadata. However, after add the metadata. The model cannot run properly.

Other info / Complete Logs

No response

kuaashish commented 2 months ago

Hi @wanggoldx,

You are correct that you need to add the metadata. The additional configuration is likely necessary because you are using an operating system we have not tested. You can find the list of supported operating systems here. Please try adding the metadata for data of type UINT8 or FLOAT32 for NormalizationOptions, as outlined here, and see if that resolves the issue.

Thank you!!

wanggoldx commented 2 months ago

Hi @wanggoldx,

You are correct that you need to add the metadata. The additional configuration is likely necessary because you are using an operating system we have not tested. You can find the list of supported operating systems here. Please try adding the metadata for data of type UINT8 or FLOAT32 for NormalizationOptions, as outlined here, and see if that resolves the issue.

Thank you!!

Actually, I have try to add the metadata before. However after adding the metadata, I have put the model to mediapipe studio to test (not the OS not tested) The output is wrong, it appear something like

螢幕擷取畫面 2024-08-23 152120

How can I solve this problem? Thank for your friendly help.