- 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:
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.