From c37220328952453018d6ba6bae2201197174a146 Mon Sep 17 00:00:00 2001 From: Richard Burton Date: Tue, 31 May 2022 11:27:26 +0100 Subject: MLECO-3213: Downgrade requirment from Python3.8 to Python3.7 Update Vela to 3.4.0 Signed-off-by: Richard Burton Change-Id: If203d29d6884219cd4947a5753a1fb8d8284f174 --- docs/quick_start.md | 2 +- docs/sections/building.md | 12 ++++++------ docs/sections/troubleshooting.md | 34 +++++++++++++++++----------------- scripts/py/requirements.txt | 4 ++-- set_up_default_resources.py | 8 ++++---- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/docs/quick_start.md b/docs/quick_start.md index d21a554..ff0646b 100644 --- a/docs/quick_start.md +++ b/docs/quick_start.md @@ -71,7 +71,7 @@ mkdir resources_downloaded && cd resources_downloaded python3 -m venv env env/bin/python3 -m pip install --upgrade pip env/bin/python3 -m pip install --upgrade setuptools -env/bin/python3 -m pip install ethos-u-vela==3.3.0 +env/bin/python3 -m pip install ethos-u-vela==3.4.0 cd .. curl -L https://github.com/ARM-software/ML-zoo/raw/7c32b097f7d94aae2cd0b98a8ed5a3ba81e66b18/models/anomaly_detection/micronet_medium/tflite_int8/ad_medium_int8.tflite \ diff --git a/docs/sections/building.md b/docs/sections/building.md index eba90b5..6c02b10 100644 --- a/docs/sections/building.md +++ b/docs/sections/building.md @@ -84,17 +84,17 @@ Before proceeding, it is *essential* to ensure that the following prerequisites > > `export PATH=$(readlink -e resources_downloaded/env/bin):${PATH}` -- Python 3.8 or above is installed. Check your current installed version of Python by running: +- Python 3.7 or above is installed. Check your current installed version of Python by running: ```commandline python3 --version ``` ```log - Python 3.8.12 + Python 3.7.13 ``` - > **Note:** If you have an older version of Python installed (< 3.8) see the + > **Note:** If you have an older version of Python installed (< 3.7) see the > [Troubleshooting](./troubleshooting.md#how-to-update-python3-package-to-newer-version) > for instruction on how to update it. @@ -113,7 +113,7 @@ Before proceeding, it is *essential* to ensure that the following prerequisites ``` ```log - pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.8) + pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.7) ``` - Make @@ -324,7 +324,7 @@ This fetches every model into the `resources_downloaded` directory. It also opti for the default 128 MACs configuration of the Arm® *Ethos™-U55* NPU and for the default 256 MACs configuration of the Arm® *Ethos™-U65* NPU. -> **Note:** This script requires Python version 3.8 or higher. Please make sure all [build prerequisites](./building.md#build-prerequisites) +> **Note:** This script requires Python version 3.7 or higher. Please make sure all [build prerequisites](./building.md#build-prerequisites) > are satisfied. > > **Note:** This script also installs required version of CMake into the virtual environment, which can be used by activating it. @@ -765,7 +765,7 @@ After compiling, your custom model has now replaced the default one in the appli > . > The source code is hosted on . -> **Note:** Using the 22.02 versions of software dependencies will require Vela to be at least version 3.3.0 +> **Note:** Using the 22.05 versions of software dependencies will require Vela to be at least version 3.4.0 > or you may encounter issues when trying to run applications on different variants of Ethos-U. The Vela compiler is a tool that can optimize a neural network model into a version that can run on an embedded system diff --git a/docs/sections/troubleshooting.md b/docs/sections/troubleshooting.md index 998600a..3603c4b 100644 --- a/docs/sections/troubleshooting.md +++ b/docs/sections/troubleshooting.md @@ -6,8 +6,8 @@ - [NPU configuration mismatch error when running inference](./troubleshooting.md#npu-configuration-mismatch-error-when-running-inference) - [Errors when cloning the repository](./troubleshooting.md#errors-when-cloning-the-repository) - [Problem installing Vela](./troubleshooting.md#problem-installing-vela) - - [No matching distribution found for ethos-u-vela==3.3.0](./troubleshooting.md#no-matching-distribution-found-for-ethos_u_vela) - - [How to update Python3 package to 3.8 version](./troubleshooting.md#how-to-update-python3-package-to-newer-version) + - [No matching distribution found for ethos-u-vela==3.4.0](./troubleshooting.md#no-matching-distribution-found-for-ethos_u_vela) + - [How to update Python3 package to 3.7 version](./troubleshooting.md#how-to-update-python3-package-to-newer-version) ## Inference results are incorrect for my custom files @@ -105,8 +105,8 @@ If the system lacks this dependency the following error will occur: x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DNPY_NO_DEPRECATED_API=NPY_1_9_API_VERSION - -I/venv/include -I/usr/include/python3.8 -I/venv/lib/python3.8/site-packages/numpy/core/include - -c ethosu/mlw_codec/mlw_codecmodule.c -o build/temp.linux-x86_64-3.8/ethosu/mlw_codec/mlw_codecmodule.o + -I/venv/include -I/usr/include/python3.7 -I/venv/lib/python3.7/site-packages/numpy/core/include + -c ethosu/mlw_codec/mlw_codecmodule.c -o build/temp.linux-x86_64-3.7/ethosu/mlw_codec/mlw_codecmodule.o ethosu/mlw_codec/mlw_codecmodule.c:20:10: fatal error: Python.h: No such file or directory 20 | #include | ^~~~~~~~~~ @@ -119,22 +119,22 @@ ERROR: Command errored out with exit status 1: /venv/bin/python -u -c (__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jidxiokn/install-record.txt --single-version-externally-managed --compile --install-headers -/venv/include/site/python3.8/ethos-u-vela Check the logs for full command output. +/venv/include/site/python3.7/ethos-u-vela Check the logs for full command output. ``` To solve this issue install libpython3 on the system. ## No matching distribution found for ethos-u-vela -Vela 3.3.0 increases Python requirement to at least version 3.8, if not installed on your system the following error will occur: +Vela 3.4.0 increases Python requirement to at least version 3.7, if not installed on your system the following error will occur: ```log -python3 -m pip install ethos-u-vela==3.3.0 -ERROR: Could not find a version that satisfies the requirement ethos-u-vela==3.3.0 (from versions: 0.1.0, 1.0.0, 1.1.0, 1.2.0, 2.0.0, 2.0.1, 2.1.1, 3.0.0, 3.1.0, 3.2.0) -ERROR: No matching distribution found for ethos-u-vela==3.3.0 +python3 -m pip install ethos-u-vela==3.4.0 +ERROR: Could not find a version that satisfies the requirement ethos-u-vela==3.4.0 (from versions: 0.1.0, 1.0.0, 1.1.0, 1.2.0, 2.0.0, 2.0.1, 2.1.1, 3.0.0, 3.1.0, 3.2.0) +ERROR: No matching distribution found for ethos-u-vela==3.4.0 ``` -Ensure that the minimum Python 3.8 requirement is installed and it's the default version. +Ensure that the minimum Python 3.7 requirement is installed and it's the default version. Check your current installed version of Python by running: ```commandline @@ -155,36 +155,36 @@ python3 --version Python 3.6.9 ``` -2. Install the Python 3.8 packages necessary on the system: +2. Install the Python 3.7 packages necessary on the system: ```commandline - sudo apt-get install python3.8 python3.8-venv libpython3.8 libpython3.8-dev + sudo apt-get install python3.7 python3.7-venv libpython3.7 libpython3.7-dev ``` 3. Update the `python3` alternatives (set as 1 your previous version displayed at step 1): ```commandline sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 - sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2 + sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2 ``` -4. At the prompt, update the configuration by selecting Python3.8 as the chosen default alternative: +4. At the prompt, update the configuration by selecting Python3.7 as the chosen default alternative: ```commandline sudo update-alternatives --config python3 ``` -5. Python3.8 is now set as default you can check it by running: +5. Python3.7 is now set as default you can check it by running: ```commandline python3 --version ``` ```log - Python 3.8.0 + Python 3.7.0 ``` -> **Note:** After updating to from Python3.6 Python3.8 it may happen that the `gnome-terminal` or the relative +> **Note:** After updating to from Python3.6 Python3.7 it may happen that the `gnome-terminal` or the relative > shortcuts doesn't work anymore. > If when opening it from XTerm with `gnome-terminal` the following error appear: > diff --git a/scripts/py/requirements.txt b/scripts/py/requirements.txt index 7b4045c..966dc82 100644 --- a/scripts/py/requirements.txt +++ b/scripts/py/requirements.txt @@ -3,11 +3,11 @@ Jinja2==2.11.2 llvmlite==0.38.0 MarkupSafe==1.1.1 numba==0.55.1 -numpy==1.19.2 +numpy==1.21.6 Pillow==7.2.0 pycparser==2.20 resampy==0.2.2 -scipy==1.8.0 +scipy==1.7.3 six==1.16.0 SoundFile==0.10.3.post1 cmake==3.22.4 diff --git a/set_up_default_resources.py b/set_up_default_resources.py index c9f83c9..2d055ef 100755 --- a/set_up_default_resources.py +++ b/set_up_default_resources.py @@ -381,9 +381,9 @@ def set_up_resources( metadata_file_path = download_dir / "resources_downloaded_metadata.json" metadata_dict = dict() - vela_version = "3.3.0" - py3_major_version_minimum = 3 # Python > 3.8 is required - py3_minor_version_minimum = 8 + vela_version = "3.4.0" + py3_major_version_minimum = 3 # Python >= 3.7 is required + py3_minor_version_minimum = 7 # Is Python minimum requirement matched? py3_version = sys.version_info @@ -392,7 +392,7 @@ def set_up_resources( or py3_version.minor < py3_minor_version_minimum ): raise Exception( - "ERROR: Python3.8+ is required, please see the documentation on how to update it." + "ERROR: Python3.7+ is required, please see the documentation on how to update it." ) setup_script_hash_verified = False -- cgit v1.2.1