-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image classification/"cannot set tensor: got value of type uint8 but expected type float32 for input 0, name: input_1 " #41
Comments
sound like your model is in the wrong format, see something like https://stackoverflow.com/questions/52530724/python-tensorflow-lite-error-cannot-set-tensor-got-tensor-of-type-1-but-expecte Issues are not a place for code reviews except for on this codebase |
Did you solve this error? If so, how did you solve it? |
@haticeozdemir My guess is a greyscale image has been passed but RGB is expected by the model |
Do you have posting your solution?
8 Eyl 2021 Çar 07:36 tarihinde Robin ***@***.***> şunu yazdı:
… @haticeozdemir <https://github.com/haticeozdemir> My guess is a greyscale
image has been passed but RGB is expected by the model
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK224NANGIZY4IQTEBE5BXLUA3R5BANCNFSM4YEMSDZQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
This example in the current (August 2022) TensorFlow documentation helped with this. The calling code can ask the TensorFlow Lite interpreter if the model needs int or float inputs and converts if needed: |
Thanks for highlighting @tonytw1 I will reopen in case anyone wants to create a pull request |
I am trying to expose my tflite image classification to web API but I keep getting the error message from fast API which says detail": "cannot set tensor: got value of type uint8 but expected type float32 for input 0, name: input_1 ". in addition, attached are the files for my web API, please how do I correct this sir, I believe there is something wrong in the codes.
Details for reproducing is found in step.txt
issue.zip
The text was updated successfully, but these errors were encountered: