From 6b345410d7ae13d1b7f1c7ba8a0f638ad7cb4570 Mon Sep 17 00:00:00 2001 From: dhrubasaha08 Date: Sun, 3 Mar 2024 00:07:50 +0530 Subject: [PATCH 1/2] Add updated environment setup instructions for Raspberry Pi OS Bookworm compatibility --- .../raspberry_pi/README.md | 63 +++++++++++++++++++ .../raspberry_pi/README.md | 62 ++++++++++++++++++ .../image_segmentation/raspberry_pi/README.md | 63 +++++++++++++++++++ .../object_detection/raspberry_pi/README.md | 63 +++++++++++++++++++ .../pose_estimation/raspberry_pi/README.md | 63 +++++++++++++++++++ .../raspberry_pi/README.md | 63 +++++++++++++++++++ .../raspberry_pi/README.md | 63 +++++++++++++++++++ 7 files changed, 440 insertions(+) diff --git a/lite/examples/audio_classification/raspberry_pi/README.md b/lite/examples/audio_classification/raspberry_pi/README.md index 1c7080037cd..b857c71d575 100644 --- a/lite/examples/audio_classification/raspberry_pi/README.md +++ b/lite/examples/audio_classification/raspberry_pi/README.md @@ -16,6 +16,69 @@ with Raspberry Pi OS (preferably updated to Buster). Raspberry Pi doesn't have a microphone integrated on its board, so you need to plug in a USB microphone to record audio. + +## Setup Environment + +To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. + +### Install Python 3.9 + +Follow these steps to install Python 3.9 from source: + +1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: + ```bash + sudo apt update + sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + ``` + +2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: + ```bash + wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz + tar xf Python-3.9.0.tar.xz + cd Python-3.9.0 + ./configure --enable-optimizations --prefix=/usr + make -j $(nproc) + sudo make altinstall + ``` + +3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: + ```bash + python3.9 --version + ``` + +### Optional: Cleanup After Installation + +To optimize disk space after the Python installation: + +1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: + ```bash + cd .. + rm -rf Python-3.9.0.tar.xz Python-3.9.0 + ``` + +2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: + ```bash + sudo apt remove --purge -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + sudo apt autoremove -y + ``` + +### Virtual Environment Setup + +Prepare and activate a virtual environment for the TensorFlow Lite examples: + +1. **Create the Environment**: + ```bash + python3.9 -m venv tflite + ``` + +2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: + ```bash + source tflite/bin/activate + ``` + +**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. + + ## Install the TensorFlow Lite runtime In this project, all you need from the TensorFlow Lite API is the `Interpreter` diff --git a/lite/examples/image_classification/raspberry_pi/README.md b/lite/examples/image_classification/raspberry_pi/README.md index d1c2b21151d..b194657d39e 100644 --- a/lite/examples/image_classification/raspberry_pi/README.md +++ b/lite/examples/image_classification/raspberry_pi/README.md @@ -24,6 +24,68 @@ to the Raspberry Pi. It's okay if you're using SSH to access the Pi shell attached to the Pi to see the camera stream. +## Setup Environment + +To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. + +### Install Python 3.9 + +Follow these steps to install Python 3.9 from source: + +1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: + ```bash + sudo apt update + sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + ``` + +2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: + ```bash + wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz + tar xf Python-3.9.0.tar.xz + cd Python-3.9.0 + ./configure --enable-optimizations --prefix=/usr + make -j $(nproc) + sudo make altinstall + ``` + +3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: + ```bash + python3.9 --version + ``` + +### Optional: Cleanup After Installation + +To optimize disk space after the Python installation: + +1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: + ```bash + cd .. + rm -rf Python-3.9.0.tar.xz Python-3.9.0 + ``` + +2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: + ```bash + sudo apt remove --purge -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + sudo apt autoremove -y + ``` + +### Virtual Environment Setup + +Prepare and activate a virtual environment for the TensorFlow Lite examples: + +1. **Create the Environment**: + ```bash + python3.9 -m venv tflite + ``` + +2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: + ```bash + source tflite/bin/activate + ``` + +**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. + + ## Install the TensorFlow Lite runtime In this project, all you need from the TensorFlow Lite API is the `Interpreter` diff --git a/lite/examples/image_segmentation/raspberry_pi/README.md b/lite/examples/image_segmentation/raspberry_pi/README.md index 8303f857148..a339c938a5d 100644 --- a/lite/examples/image_segmentation/raspberry_pi/README.md +++ b/lite/examples/image_segmentation/raspberry_pi/README.md @@ -23,6 +23,69 @@ Raspberry Pi. It's okay if you're using SSH to access the Pi shell (you don't need to use a keyboard connected to the Pi)—you only need a monitor attached to the Pi to see the camera stream. + +## Setup Environment + +To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. + +### Install Python 3.9 + +Follow these steps to install Python 3.9 from source: + +1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: + ```bash + sudo apt update + sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + ``` + +2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: + ```bash + wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz + tar xf Python-3.9.0.tar.xz + cd Python-3.9.0 + ./configure --enable-optimizations --prefix=/usr + make -j $(nproc) + sudo make altinstall + ``` + +3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: + ```bash + python3.9 --version + ``` + +### Optional: Cleanup After Installation + +To optimize disk space after the Python installation: + +1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: + ```bash + cd .. + rm -rf Python-3.9.0.tar.xz Python-3.9.0 + ``` + +2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: + ```bash + sudo apt remove --purge -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + sudo apt autoremove -y + ``` + +### Virtual Environment Setup + +Prepare and activate a virtual environment for the TensorFlow Lite examples: + +1. **Create the Environment**: + ```bash + python3.9 -m venv tflite + ``` + +2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: + ```bash + source tflite/bin/activate + ``` + +**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. + + ## Install the TensorFlow Lite runtime In this project, all you need from the TensorFlow Lite API is the `Interpreter` diff --git a/lite/examples/object_detection/raspberry_pi/README.md b/lite/examples/object_detection/raspberry_pi/README.md index b2eae890494..6d2b74a21e6 100644 --- a/lite/examples/object_detection/raspberry_pi/README.md +++ b/lite/examples/object_detection/raspberry_pi/README.md @@ -24,6 +24,69 @@ Raspberry Pi. It's okay if you're using SSH to access the Pi shell (you don't need to use a keyboard connected to the Pi)—you only need a monitor attached to the Pi to see the camera stream. + +## Setup Environment + +To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. + +### Install Python 3.9 + +Follow these steps to install Python 3.9 from source: + +1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: + ```bash + sudo apt update + sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + ``` + +2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: + ```bash + wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz + tar xf Python-3.9.0.tar.xz + cd Python-3.9.0 + ./configure --enable-optimizations --prefix=/usr + make -j $(nproc) + sudo make altinstall + ``` + +3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: + ```bash + python3.9 --version + ``` + +### Optional: Cleanup After Installation + +To optimize disk space after the Python installation: + +1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: + ```bash + cd .. + rm -rf Python-3.9.0.tar.xz Python-3.9.0 + ``` + +2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: + ```bash + sudo apt remove --purge -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + sudo apt autoremove -y + ``` + +### Virtual Environment Setup + +Prepare and activate a virtual environment for the TensorFlow Lite examples: + +1. **Create the Environment**: + ```bash + python3.9 -m venv tflite + ``` + +2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: + ```bash + source tflite/bin/activate + ``` + +**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. + + ## Download the example files First, clone this Git repo onto your Raspberry Pi like this: diff --git a/lite/examples/pose_estimation/raspberry_pi/README.md b/lite/examples/pose_estimation/raspberry_pi/README.md index c4c8c6d8842..58801529107 100644 --- a/lite/examples/pose_estimation/raspberry_pi/README.md +++ b/lite/examples/pose_estimation/raspberry_pi/README.md @@ -16,6 +16,69 @@ This sample can run on Raspberry Pi or any computer that has a camera. It uses OpenCV to capture images from the camera and TensorFlow Lite to run inference on the input image. + +## Setup Environment + +To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. + +### Install Python 3.9 + +Follow these steps to install Python 3.9 from source: + +1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: + ```bash + sudo apt update + sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + ``` + +2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: + ```bash + wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz + tar xf Python-3.9.0.tar.xz + cd Python-3.9.0 + ./configure --enable-optimizations --prefix=/usr + make -j $(nproc) + sudo make altinstall + ``` + +3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: + ```bash + python3.9 --version + ``` + +### Optional: Cleanup After Installation + +To optimize disk space after the Python installation: + +1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: + ```bash + cd .. + rm -rf Python-3.9.0.tar.xz Python-3.9.0 + ``` + +2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: + ```bash + sudo apt remove --purge -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + sudo apt autoremove -y + ``` + +### Virtual Environment Setup + +Prepare and activate a virtual environment for the TensorFlow Lite examples: + +1. **Create the Environment**: + ```bash + python3.9 -m venv tflite + ``` + +2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: + ```bash + source tflite/bin/activate + ``` + +**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. + + ## Install the dependencies * Run this script to install the Python dependencies, and download the TFLite diff --git a/lite/examples/sound_classification/raspberry_pi/README.md b/lite/examples/sound_classification/raspberry_pi/README.md index 82281791352..75c8cab982d 100644 --- a/lite/examples/sound_classification/raspberry_pi/README.md +++ b/lite/examples/sound_classification/raspberry_pi/README.md @@ -16,6 +16,69 @@ with Raspberry Pi OS (preferably updated to Buster). Raspberry Pi doesn't have a microphone integrated on its board, so you need to plug in a USB microphone to record audio. + +## Setup Environment + +To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. + +### Install Python 3.9 + +Follow these steps to install Python 3.9 from source: + +1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: + ```bash + sudo apt update + sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + ``` + +2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: + ```bash + wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz + tar xf Python-3.9.0.tar.xz + cd Python-3.9.0 + ./configure --enable-optimizations --prefix=/usr + make -j $(nproc) + sudo make altinstall + ``` + +3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: + ```bash + python3.9 --version + ``` + +### Optional: Cleanup After Installation + +To optimize disk space after the Python installation: + +1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: + ```bash + cd .. + rm -rf Python-3.9.0.tar.xz Python-3.9.0 + ``` + +2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: + ```bash + sudo apt remove --purge -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + sudo apt autoremove -y + ``` + +### Virtual Environment Setup + +Prepare and activate a virtual environment for the TensorFlow Lite examples: + +1. **Create the Environment**: + ```bash + python3.9 -m venv tflite + ``` + +2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: + ```bash + source tflite/bin/activate + ``` + +**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. + + ## Install the TensorFlow Lite runtime In this project, all you need from the TensorFlow Lite API is the `Interpreter` diff --git a/lite/examples/video_classification/raspberry_pi/README.md b/lite/examples/video_classification/raspberry_pi/README.md index e7b6175bc20..c5cee2c0fe6 100644 --- a/lite/examples/video_classification/raspberry_pi/README.md +++ b/lite/examples/video_classification/raspberry_pi/README.md @@ -20,6 +20,69 @@ Raspberry Pi. It's okay if you're using SSH to access the Pi shell (you don't need to use a keyboard connected to the Pi)—you only need a monitor attached to the Pi to see the camera stream. + +## Setup Environment + +To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. + +### Install Python 3.9 + +Follow these steps to install Python 3.9 from source: + +1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: + ```bash + sudo apt update + sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + ``` + +2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: + ```bash + wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz + tar xf Python-3.9.0.tar.xz + cd Python-3.9.0 + ./configure --enable-optimizations --prefix=/usr + make -j $(nproc) + sudo make altinstall + ``` + +3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: + ```bash + python3.9 --version + ``` + +### Optional: Cleanup After Installation + +To optimize disk space after the Python installation: + +1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: + ```bash + cd .. + rm -rf Python-3.9.0.tar.xz Python-3.9.0 + ``` + +2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: + ```bash + sudo apt remove --purge -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget + sudo apt autoremove -y + ``` + +### Virtual Environment Setup + +Prepare and activate a virtual environment for the TensorFlow Lite examples: + +1. **Create the Environment**: + ```bash + python3.9 -m venv tflite + ``` + +2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: + ```bash + source tflite/bin/activate + ``` + +**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. + + ## Install the TensorFlow Lite runtime In this project, all you need from the TensorFlow Lite API is the `Interpreter` From a161dbb49fdaef14f822c1b1c312d1a0c1b12474 Mon Sep 17 00:00:00 2001 From: dhrubasaha08 Date: Sun, 3 Mar 2024 01:01:47 +0530 Subject: [PATCH 2/2] Add updated environment setup instructions for Raspberry Pi OS Bookworm compatibility --- .../raspberry_pi/README.md | 24 +++++++++++-------- .../raspberry_pi/README.md | 24 +++++++++++-------- .../image_segmentation/raspberry_pi/README.md | 24 +++++++++++-------- .../object_detection/raspberry_pi/README.md | 24 +++++++++++-------- .../pose_estimation/raspberry_pi/README.md | 24 +++++++++++-------- .../raspberry_pi/README.md | 24 +++++++++++-------- .../raspberry_pi/README.md | 24 +++++++++++-------- 7 files changed, 98 insertions(+), 70 deletions(-) diff --git a/lite/examples/audio_classification/raspberry_pi/README.md b/lite/examples/audio_classification/raspberry_pi/README.md index b857c71d575..e64614b628d 100644 --- a/lite/examples/audio_classification/raspberry_pi/README.md +++ b/lite/examples/audio_classification/raspberry_pi/README.md @@ -21,9 +21,9 @@ plug in a USB microphone to record audio. To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. -### Install Python 3.9 +### Install Python 3.9.0 -Follow these steps to install Python 3.9 from source: +Follow these steps to install Python from source: 1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: ```bash @@ -31,7 +31,7 @@ Follow these steps to install Python 3.9 from source: sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget ``` -2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: +2. **Compile and Install Python**: Download, extract, and install Python: ```bash wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz tar xf Python-3.9.0.tar.xz @@ -41,19 +41,23 @@ Follow these steps to install Python 3.9 from source: sudo make altinstall ``` -3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: +3. **Verify Python Installation**: Ensure Python 3.9.0 is installed successfully: ```bash python3.9 --version ``` +4. **Change Directory**: Move out of the Python source directory: + ```bash + cd .. + ``` + ### Optional: Cleanup After Installation To optimize disk space after the Python installation: -1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: +1. **Remove Python Source Files**: Next, use `sudo` to remove the downloaded archive and the extracted Python source directory: ```bash - cd .. - rm -rf Python-3.9.0.tar.xz Python-3.9.0 + sudo rm -rf Python-3.9.0.tar.xz Python-3.9.0 ``` 2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: @@ -68,15 +72,15 @@ Prepare and activate a virtual environment for the TensorFlow Lite examples: 1. **Create the Environment**: ```bash - python3.9 -m venv tflite + python3.9 -m venv /usr/local/venvs/tflite ``` 2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: ```bash - source tflite/bin/activate + source /usr/local/venvs/tflite/bin/activate ``` -**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. +**Note**: Remember to reactivate the `tflite` environment with `/usr/local/venvs/tflite/bin/activate` each time you work on the TensorFlow Lite examples. ## Install the TensorFlow Lite runtime diff --git a/lite/examples/image_classification/raspberry_pi/README.md b/lite/examples/image_classification/raspberry_pi/README.md index b194657d39e..97fe22558db 100644 --- a/lite/examples/image_classification/raspberry_pi/README.md +++ b/lite/examples/image_classification/raspberry_pi/README.md @@ -28,9 +28,9 @@ attached to the Pi to see the camera stream. To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. -### Install Python 3.9 +### Install Python 3.9.0 -Follow these steps to install Python 3.9 from source: +Follow these steps to install Python from source: 1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: ```bash @@ -38,7 +38,7 @@ Follow these steps to install Python 3.9 from source: sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget ``` -2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: +2. **Compile and Install Python**: Download, extract, and install Python: ```bash wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz tar xf Python-3.9.0.tar.xz @@ -48,19 +48,23 @@ Follow these steps to install Python 3.9 from source: sudo make altinstall ``` -3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: +3. **Verify Python Installation**: Ensure Python 3.9.0 is installed successfully: ```bash python3.9 --version ``` +4. **Change Directory**: Move out of the Python source directory: + ```bash + cd .. + ``` + ### Optional: Cleanup After Installation To optimize disk space after the Python installation: -1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: +1. **Remove Python Source Files**: Next, use `sudo` to remove the downloaded archive and the extracted Python source directory: ```bash - cd .. - rm -rf Python-3.9.0.tar.xz Python-3.9.0 + sudo rm -rf Python-3.9.0.tar.xz Python-3.9.0 ``` 2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: @@ -75,15 +79,15 @@ Prepare and activate a virtual environment for the TensorFlow Lite examples: 1. **Create the Environment**: ```bash - python3.9 -m venv tflite + python3.9 -m venv /usr/local/venvs/tflite ``` 2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: ```bash - source tflite/bin/activate + source /usr/local/venvs/tflite/bin/activate ``` -**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. +**Note**: Remember to reactivate the `tflite` environment with `/usr/local/venvs/tflite/bin/activate` each time you work on the TensorFlow Lite examples. ## Install the TensorFlow Lite runtime diff --git a/lite/examples/image_segmentation/raspberry_pi/README.md b/lite/examples/image_segmentation/raspberry_pi/README.md index a339c938a5d..34f81e67f1c 100644 --- a/lite/examples/image_segmentation/raspberry_pi/README.md +++ b/lite/examples/image_segmentation/raspberry_pi/README.md @@ -28,9 +28,9 @@ the Pi to see the camera stream. To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. -### Install Python 3.9 +### Install Python 3.9.0 -Follow these steps to install Python 3.9 from source: +Follow these steps to install Python from source: 1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: ```bash @@ -38,7 +38,7 @@ Follow these steps to install Python 3.9 from source: sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget ``` -2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: +2. **Compile and Install Python**: Download, extract, and install Python: ```bash wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz tar xf Python-3.9.0.tar.xz @@ -48,19 +48,23 @@ Follow these steps to install Python 3.9 from source: sudo make altinstall ``` -3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: +3. **Verify Python Installation**: Ensure Python 3.9.0 is installed successfully: ```bash python3.9 --version ``` +4. **Change Directory**: Move out of the Python source directory: + ```bash + cd .. + ``` + ### Optional: Cleanup After Installation To optimize disk space after the Python installation: -1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: +1. **Remove Python Source Files**: Next, use `sudo` to remove the downloaded archive and the extracted Python source directory: ```bash - cd .. - rm -rf Python-3.9.0.tar.xz Python-3.9.0 + sudo rm -rf Python-3.9.0.tar.xz Python-3.9.0 ``` 2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: @@ -75,15 +79,15 @@ Prepare and activate a virtual environment for the TensorFlow Lite examples: 1. **Create the Environment**: ```bash - python3.9 -m venv tflite + python3.9 -m venv /usr/local/venvs/tflite ``` 2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: ```bash - source tflite/bin/activate + source /usr/local/venvs/tflite/bin/activate ``` -**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. +**Note**: Remember to reactivate the `tflite` environment with `/usr/local/venvs/tflite/bin/activate` each time you work on the TensorFlow Lite examples. ## Install the TensorFlow Lite runtime diff --git a/lite/examples/object_detection/raspberry_pi/README.md b/lite/examples/object_detection/raspberry_pi/README.md index 6d2b74a21e6..bd7a1fff19e 100644 --- a/lite/examples/object_detection/raspberry_pi/README.md +++ b/lite/examples/object_detection/raspberry_pi/README.md @@ -29,9 +29,9 @@ the Pi to see the camera stream. To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. -### Install Python 3.9 +### Install Python 3.9.0 -Follow these steps to install Python 3.9 from source: +Follow these steps to install Python from source: 1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: ```bash @@ -39,7 +39,7 @@ Follow these steps to install Python 3.9 from source: sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget ``` -2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: +2. **Compile and Install Python**: Download, extract, and install Python: ```bash wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz tar xf Python-3.9.0.tar.xz @@ -49,19 +49,23 @@ Follow these steps to install Python 3.9 from source: sudo make altinstall ``` -3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: +3. **Verify Python Installation**: Ensure Python 3.9.0 is installed successfully: ```bash python3.9 --version ``` +4. **Change Directory**: Move out of the Python source directory: + ```bash + cd .. + ``` + ### Optional: Cleanup After Installation To optimize disk space after the Python installation: -1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: +1. **Remove Python Source Files**: Next, use `sudo` to remove the downloaded archive and the extracted Python source directory: ```bash - cd .. - rm -rf Python-3.9.0.tar.xz Python-3.9.0 + sudo rm -rf Python-3.9.0.tar.xz Python-3.9.0 ``` 2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: @@ -76,15 +80,15 @@ Prepare and activate a virtual environment for the TensorFlow Lite examples: 1. **Create the Environment**: ```bash - python3.9 -m venv tflite + python3.9 -m venv /usr/local/venvs/tflite ``` 2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: ```bash - source tflite/bin/activate + source /usr/local/venvs/tflite/bin/activate ``` -**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. +**Note**: Remember to reactivate the `tflite` environment with `/usr/local/venvs/tflite/bin/activate` each time you work on the TensorFlow Lite examples. ## Download the example files diff --git a/lite/examples/pose_estimation/raspberry_pi/README.md b/lite/examples/pose_estimation/raspberry_pi/README.md index 58801529107..adfcca60f14 100644 --- a/lite/examples/pose_estimation/raspberry_pi/README.md +++ b/lite/examples/pose_estimation/raspberry_pi/README.md @@ -21,9 +21,9 @@ the input image. To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. -### Install Python 3.9 +### Install Python 3.9.0 -Follow these steps to install Python 3.9 from source: +Follow these steps to install Python from source: 1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: ```bash @@ -31,7 +31,7 @@ Follow these steps to install Python 3.9 from source: sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget ``` -2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: +2. **Compile and Install Python**: Download, extract, and install Python: ```bash wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz tar xf Python-3.9.0.tar.xz @@ -41,19 +41,23 @@ Follow these steps to install Python 3.9 from source: sudo make altinstall ``` -3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: +3. **Verify Python Installation**: Ensure Python 3.9.0 is installed successfully: ```bash python3.9 --version ``` +4. **Change Directory**: Move out of the Python source directory: + ```bash + cd .. + ``` + ### Optional: Cleanup After Installation To optimize disk space after the Python installation: -1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: +1. **Remove Python Source Files**: Next, use `sudo` to remove the downloaded archive and the extracted Python source directory: ```bash - cd .. - rm -rf Python-3.9.0.tar.xz Python-3.9.0 + sudo rm -rf Python-3.9.0.tar.xz Python-3.9.0 ``` 2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: @@ -68,15 +72,15 @@ Prepare and activate a virtual environment for the TensorFlow Lite examples: 1. **Create the Environment**: ```bash - python3.9 -m venv tflite + python3.9 -m venv /usr/local/venvs/tflite ``` 2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: ```bash - source tflite/bin/activate + source /usr/local/venvs/tflite/bin/activate ``` -**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. +**Note**: Remember to reactivate the `tflite` environment with `/usr/local/venvs/tflite/bin/activate` each time you work on the TensorFlow Lite examples. ## Install the dependencies diff --git a/lite/examples/sound_classification/raspberry_pi/README.md b/lite/examples/sound_classification/raspberry_pi/README.md index 75c8cab982d..53b695832bc 100644 --- a/lite/examples/sound_classification/raspberry_pi/README.md +++ b/lite/examples/sound_classification/raspberry_pi/README.md @@ -21,9 +21,9 @@ plug in a USB microphone to record audio. To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. -### Install Python 3.9 +### Install Python 3.9.0 -Follow these steps to install Python 3.9 from source: +Follow these steps to install Python from source: 1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: ```bash @@ -31,7 +31,7 @@ Follow these steps to install Python 3.9 from source: sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget ``` -2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: +2. **Compile and Install Python**: Download, extract, and install Python: ```bash wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz tar xf Python-3.9.0.tar.xz @@ -41,19 +41,23 @@ Follow these steps to install Python 3.9 from source: sudo make altinstall ``` -3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: +3. **Verify Python Installation**: Ensure Python 3.9.0 is installed successfully: ```bash python3.9 --version ``` +4. **Change Directory**: Move out of the Python source directory: + ```bash + cd .. + ``` + ### Optional: Cleanup After Installation To optimize disk space after the Python installation: -1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: +1. **Remove Python Source Files**: Next, use `sudo` to remove the downloaded archive and the extracted Python source directory: ```bash - cd .. - rm -rf Python-3.9.0.tar.xz Python-3.9.0 + sudo rm -rf Python-3.9.0.tar.xz Python-3.9.0 ``` 2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: @@ -68,15 +72,15 @@ Prepare and activate a virtual environment for the TensorFlow Lite examples: 1. **Create the Environment**: ```bash - python3.9 -m venv tflite + python3.9 -m venv /usr/local/venvs/tflite ``` 2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: ```bash - source tflite/bin/activate + source /usr/local/venvs/tflite/bin/activate ``` -**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. +**Note**: Remember to reactivate the `tflite` environment with `/usr/local/venvs/tflite/bin/activate` each time you work on the TensorFlow Lite examples. ## Install the TensorFlow Lite runtime diff --git a/lite/examples/video_classification/raspberry_pi/README.md b/lite/examples/video_classification/raspberry_pi/README.md index c5cee2c0fe6..716da8bbfcc 100644 --- a/lite/examples/video_classification/raspberry_pi/README.md +++ b/lite/examples/video_classification/raspberry_pi/README.md @@ -25,9 +25,9 @@ the Pi to see the camera stream. To ensure the TensorFlow Lite examples run smoothly on Raspberry Pi OS based on Debian Bookworm (2024 release), setting up a Python virtual environment is crucial. This setup guarantees compatibility with Python 3.9 and effectively manages the dependencies for your examples. -### Install Python 3.9 +### Install Python 3.9.0 -Follow these steps to install Python 3.9 from source: +Follow these steps to install Python from source: 1. **Install Build Dependencies**: Begin by updating your system and installing the required packages: ```bash @@ -35,7 +35,7 @@ Follow these steps to install Python 3.9 from source: sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget ``` -2. **Compile and Install Python 3.9**: Download, extract, and install Python 3.9: +2. **Compile and Install Python**: Download, extract, and install Python: ```bash wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz tar xf Python-3.9.0.tar.xz @@ -45,19 +45,23 @@ Follow these steps to install Python 3.9 from source: sudo make altinstall ``` -3. **Verify Python Installation**: Ensure Python 3.9 is installed successfully: +3. **Verify Python Installation**: Ensure Python 3.9.0 is installed successfully: ```bash python3.9 --version ``` +4. **Change Directory**: Move out of the Python source directory: + ```bash + cd .. + ``` + ### Optional: Cleanup After Installation To optimize disk space after the Python installation: -1. **Remove Python Source Files**: Eliminate the no-longer-needed source files: +1. **Remove Python Source Files**: Next, use `sudo` to remove the downloaded archive and the extracted Python source directory: ```bash - cd .. - rm -rf Python-3.9.0.tar.xz Python-3.9.0 + sudo rm -rf Python-3.9.0.tar.xz Python-3.9.0 ``` 2. **Remove Build Dependencies**: Optionally, uninstall the build dependencies if they are no longer necessary: @@ -72,15 +76,15 @@ Prepare and activate a virtual environment for the TensorFlow Lite examples: 1. **Create the Environment**: ```bash - python3.9 -m venv tflite + python3.9 -m venv /usr/local/venvs/tflite ``` 2. **Activate the Environment**: Always reactivate the virtual environment in new sessions: ```bash - source tflite/bin/activate + source /usr/local/venvs/tflite/bin/activate ``` -**Note**: Remember to reactivate the `tflite` environment with `source tflite/bin/activate` each time you work on the TensorFlow Lite examples. +**Note**: Remember to reactivate the `tflite` environment with `/usr/local/venvs/tflite/bin/activate` each time you work on the TensorFlow Lite examples. ## Install the TensorFlow Lite runtime