What is the error when trying to install Tenserflow. I have tried to install the library, and supposedly I have succeeded, but when executing a code that requires the use of this library, the following error appears:
Traceback (most recent call last):
File “/home/pi/VA/identificador_residuos.py”, line 3, in
import tensorflow as tf
ModuleNotFoundError: No module named ‘tensorflow’
Traceback (most recent call last):
File “/home/pi/VA/identificador_residuos.py”, line 3, in
import tensorflow as tf
ModuleNotFoundError: No module named ‘tensorflow’
I hope you can help me solve this problem, the truth is that I have spent several days trying to understand what is happening, consulting and watching videos on the subject, but none have worked for me.
Hi @Alexander_S, Could you please let us know the steps that you have followed to install Tensorflow, and which Operating system you are using. Thank You.
These are the features of the operating system with python 3.9.2:
Raspberry Pi OS with desktop
Release date: February 21st 2023
System: 64-bit
Kernel version: 5.15
Debian version: 11 (bullseye)
Size: 816MB
Show SHA256 file integrity hash:
Release notes
The first thing I did was create a virtual environment inside a folder. Then activate the virtual environment. Once I’ve done this, do the following:
- Try to install tenserflow from the terminal using “pip3 install tenserflow” and also install keras, which are necessary libraries for the code I’m using from my project.
- Run the python code of my project (Doing this gave me the error I posted).
For this problem I was looking for different sources and I found a video from a youtube channel, which shows how to install tenserflow and opencv manually from a Github repository. Although I followed the steps in the video, I still kept getting errors regarding the incorrect installation of the library.
What I’m trying to do by installing these libraries is to apply a machine learning model to detect residues. For this I use the raspberry pi 3B+ and the raspberry camera module V2. The model that I train I get from a tool called “Teachable Machine”. Once I train the model with this tool, I download 2 files that are generated in .h5 and .txt, which correspond to the code and the object classes of my project.