Skip to content
Snippets Groups Projects
Commit e287512f authored by Daniel Müller's avatar Daniel Müller :speech_balloon:
Browse files

Update README

parent a6c239f5
No related branches found
No related tags found
No related merge requests found
...@@ -7,11 +7,13 @@ ...@@ -7,11 +7,13 @@
- Jupyter-lab is served on `0.0.0.0:8888` with an empty password. This of course has security implications and should be discussed - Jupyter-lab is served on `0.0.0.0:8888` with an empty password. This of course has security implications and should be discussed
- Install the following python3 packages: - Install the following python3 packages:
- numpy - numpy
- sklearn - scikit-learn (aka. sklearn)
- matplotlib - matplotlib
- pandas - pandas
- Pillow - Pillow
- On the desktop version of Raspberry Pi OS, `pil` and `numpy` are preinstalled from the APT repository and will be removed in favour the `pip3` versions. This behavior should be discussed, as there might be further problems caused by incompatible packages depending on the use of either APT or pip python packages - seaborn
- plotly
- All python packages are installed into a virtual environment at `~/.ml-venv`. This also includes jupyter-lab which allows for using the default python3 kernel and still having access to all dependencies
### The project is structured as follows: ### The project is structured as follows:
- [local.yml](./local.yml): The main playbook file, can be seen as the entry point - [local.yml](./local.yml): The main playbook file, can be seen as the entry point
...@@ -22,7 +24,6 @@ ...@@ -22,7 +24,6 @@
- [ml-python-packages](./roles/ml-python-packages/tasks/main.yml): Install the machine learning python packages - [ml-python-packages](./roles/ml-python-packages/tasks/main.yml): Install the machine learning python packages
# Using the ansible playbook on Raspberry Pi OS # Using the ansible playbook on Raspberry Pi OS
Steps to run the ansible script on a fresh (or not fresh) installation of raspberry pi os: Steps to run the ansible script on a fresh (or not fresh) installation of raspberry pi os:
...@@ -33,16 +34,15 @@ sudo apt update ...@@ -33,16 +34,15 @@ sudo apt update
sudo apt install -y --no-install-recommends ansible git sudo apt install -y --no-install-recommends ansible git
# Pull and run the ansible scripts from git # Pull and run the ansible scripts from git
# NOTE: Since the repository is currently private, the gitlab login prompt will shown. When using ansible-pull -U https://code.fbi.h-da.de/pse-ai-at-the-edge/raspberry-pi-setup.git
# 2FA for gitlab the password login is not possible and an access token is needed. This will be
# fixed in the future
sudo ansible-pull -U https://code.fbi.h-da.de/pse-ai-at-the-edge/raspberry-pi-setup.git
``` ```
# Notes # Notes
## 64-Bit Raspberry Pi OS (Desktop) ## Raspberry Pi OS Version and Architecture
This current version of the playbook will install a prebuilt `tensorflow-2.7` wheel that only works on `Python3.9` and the `Aarch64` architecture.
That means for now the playbook **only works on Raspberry Pi OS 11 64-bit**
There were major problems when trying to install the software on 64-Bit Pi OS. Multiple python packages started to compile C/C++ library code on the device which caused extreme increases of installation times and full failures due to the 1GB RAM on model 3B beeing completely used up. Jupyter-lab also needed an additional dependency (`libffi-dev`) to compile its backend. This behavior occurred when installing packages using `pip3`, but not when using APT. Since some packages are not available, or too old on APT pip can't be fully avoided. ### Updating the playbook for 32-bit Raspberry Pi OS
Besides `tensorflow` all other dependencies will pretty much work regardless of architecture and python3 version. So to make this playbook work on 32-bit a decision must be made depending on the architecture. On 32-bit a different prebuilt `tensorflow` wheel must be used, as well as another `numpy` version.
This might be caused by those python libraries depending on C/C++ code which is either shipped precompile or build on device. In this case there might be a precompiled version available for armv7 (32-bit) but not for aarch64 (64-bit), causing the C/C++ code to be compiled on device with the 64-bit OS and not with the 32-bit OS.
...@@ -36,5 +36,7 @@ ...@@ -36,5 +36,7 @@
when: "tfinstalled.rc != 0" when: "tfinstalled.rc != 0"
- name: Download and install prebuilt tensorflow wheel - name: Download and install prebuilt tensorflow wheel
become: true
become_user: "{{ target_user }}"
shell: ". /home/{{ target_user }}/.ml-venv/bin/activate && bash /tmp/tensorflow-install.sh" shell: ". /home/{{ target_user }}/.ml-venv/bin/activate && bash /tmp/tensorflow-install.sh"
when: "tfinstalled.rc != 0" when: "tfinstalled.rc != 0"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment