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
[RPI Zero] ModuleNotFoundError: No module named 'tflite_runtime' #41112
Comments
I am still facing this issue on RPI Zero. |
This are prebuilt Python wheels of tflite_runtime package. https://www.tensorflow.org/lite/guide/python If it doesn't work, you might need to build it by yourself. |
t
I am using https://www.tensorflow.org/lite/guide/build_rpi. For Compile natively on Raspberry Pi. The site states that "The following instructions have been tested on Raspberry Pi Zero, Raspbian GNU/Linux 10 (buster), gcc version 8.3.0 (Raspbian 8.3.0-6+rpi1)". So I am puzzled at this thing not working on rpi zero and giving the error. I have done it a few times with the same error. The site which you are referring to does not have arm6l whl. |
libtensorflow-lite.a will work with your RPI zero. But it's C library not Python. You might be able to build it on RPI zero with the following command.
|
terryheo...it ran something as it says on webpage but it is giving error. I am trying on RP4 now as RP0 is slow and if I can make whl on RP4, I can try on RP0 later. I had to modify commands like this 'cd tensorflow_src && ./tensorflow/lite/tools/pip_package/build_pip_package.sh' collect2: error: ld returned 1 exit status |
and where does it create whl file, when it creates. |
If you're using RPI4, just use prebuilt from https://www.tensorflow.org/lite/guide/python |
I did that but my end goal is to work on RPi Zero and I am struggling. Not an expert so learning as I go. The instructions are failing from the link. Not sure if I am missing something. The sh commands are not working as it is so I am modifying as mentioned above. |
FYI I was able to find a working solution for running tensorflow(lite as well) on the ARM6 based raspberry pi (like the zero or the Pi1):
in python:
After a long time looking for a good solution and struggling with static libs and cross compiling, I found this working pretty well and easy! |
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you. |
Closing as stale. Please reopen if you'd like to work on this further. |
Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template
System information
Describe the problem
Trying to install Tensorflow Lite on RPI Zero as a standalone. However once installation is complete as per the following steps,
sudo apt-get install build-essential
git clone https://github.com/tensorflow/tensorflow.git tensorflow_src
cd tensorflow_src && ./tensorflow/lite/tools/make/download_dependencies.sh
./tensorflow/lite/tools/make/build_rpi_lib.sh
I can not import,
import tflite_runtime.interpreter as tflite
Error I am getting is
ModuleNotFoundError: No module named 'tflite_runtime'
In addition as per the instructions, I should see a static library. I do not see this either.
tensorflow/lite/tools/make/gen/lib/rpi_armv6/libtensorflow-lite.a
Any other info / logs
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
The text was updated successfully, but these errors were encountered: