- Newest
- Most votes
- Most comments
The issue you're experiencing with the TensorFlowLiteImageClassification test failing appears to be related to a compatibility problem between the TensorFlow Lite component and the version of NumPy installed on your system.
Even though you mentioned that your NumPy version is already less than 2, the error message suggests that there might be a mismatch between the version of NumPy used to compile the TensorFlow Lite module and the version currently installed on your system.
To resolve this issue, you can try the following steps:
-
Verify the exact version of NumPy installed on your system by running
pip3 list | grep numpyorpython3 -c "import numpy; print(numpy.__version__)". -
If the NumPy version is 2.x, try downgrading it to a 1.x version, preferably 1.22.4 or later. You can do this by running:
pip3 install --upgrade numpy==1.22.4 -
If you're using a Raspberry Pi device running Raspberry Pi OS Bullseye, make sure you have NumPy 1.22.4 or later installed, as earlier versions that come with the OS may not be compatible.
-
Ensure that all the required dependencies for the TensorFlow Lite components are installed, especially for Armv7l devices like Raspberry Pi. You may need to run:
sudo apt-get install libopenjp2-7 libilmbase23 libopenexr-dev libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libgtk-3-0 libwebp-dev -
If you're using a Raspberry Pi with Raspberry Pi OS Bullseye, make sure the legacy camera stack is enabled, as the new camera stack is not compatible with this component.
-
After making these changes, try redeploying the TensorFlow Lite components and running the qualification test again.
If the issue persists, you may need to check if there are any compatibility issues between the TensorFlow Lite components and your specific Debian aarch64 setup. Consider reaching out to AWS support for further assistance, as they may have more specific guidance for your particular hardware and software configuration.
Sources
TensorFlow Lite runtime - AWS IoT Greengrass
Configure your device to run IDT tests - AWS IoT Greengrass
TensorFlow Lite image classification model store - AWS IoT Greengrass
Hi Greg_B
But my PreInstalled is set to 'no'. From the logs, it seems that IDT installed numpy by itself. The version of numpy installed on my DUT is also below 2.
2024-10-29T10:00:08.982Z [WARN] (Copier) variant.TensorFlowLite: stderr. + source ../variant.TensorFlowLite/greengrass_ml/greengrass_ml_tflite_venv/bin/activate. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:08.997Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ deactivate nondestructive. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:08.999Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ '[' -n '' ']'. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ '[' -n '' ']'. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.001Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ '[' -n /usr/bin/bash -o -n '' ']'. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.002Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ hash -r. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.003Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ '[' -n '' ']'. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.004Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ unset VIRTUAL_ENV. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.005Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ '[' '!' nondestructive = nondestructive ']'. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.006Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ VIRTUAL_ENV=/greengrass/v2/idt-055f425063677087b33/work/variant.TensorFlowLite/greengrass_ml/greengrass_ml_tflite_venv. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.008Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ export VIRTUAL_ENV. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.009Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ _OLD_VIRTUAL_PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.010Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ PATH=/greengrass/v2/idt-055f425063677087b33/work/variant.TensorFlowLite/greengrass_ml/greengrass_ml_tflite_venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.011Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ export PATH. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.012Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ '[' -n '' ']'. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.013Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ '[' -z '' ']'. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.014Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ _OLD_VIRTUAL_PS1=. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.015Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ PS1='(greengrass_ml_tflite_venv) '. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.016Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ export PS1. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.017Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ '[' -n /usr/bin/bash -o -n '' ']'. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.018Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ hash -r. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.019Z [WARN] (Copier) variant.TensorFlowLite: stderr. + cd ../variant.TensorFlowLite/greengrass_ml/greengrass_ml_tflite_venv. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.020Z [WARN] (Copier) variant.TensorFlowLite: stderr. + install_python3_libraries. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.021Z [WARN] (Copier) variant.TensorFlowLite: stderr. ++ python3 -c 'try:. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.023Z [WARN] (Copier) variant.TensorFlowLite: stderr. import cv2. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.024Z [WARN] (Copier) variant.TensorFlowLite: stderr. print(cv2.__version__). {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.025Z [WARN] (Copier) variant.TensorFlowLite: stderr. except Exception as e:. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.026Z [WARN] (Copier) variant.TensorFlowLite: stderr. print(e)'. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.094Z [WARN] (Copier) variant.TensorFlowLite: stderr. + opencv='No module named '\''cv2'\'''. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.094Z [INFO] (Copier) variant.TensorFlowLite: stdout. Installing opencv.... {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.096Z [WARN] (Copier) variant.TensorFlowLite: stderr. + [[ No module named 'cv2' == *\N\o\ \m\o\d\u\l\e\ \n\a\m\e\d\ \'\c\v\2\'* ]]. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.097Z [WARN] (Copier) variant.TensorFlowLite: stderr. + echo 'Installing opencv...'. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:09.098Z [WARN] (Copier) variant.TensorFlowLite: stderr. + pip3 install opencv-python. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:27.910Z [INFO] (Copier) variant.TensorFlowLite: stdout. Collecting opencv-python. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:28.328Z [INFO] (Copier) variant.TensorFlowLite: stdout. Using cached opencv_python-4.10.0.84-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (41.7 MB). {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:36.166Z [INFO] (Copier) variant.TensorFlowLite: stdout. Collecting numpy>=1.17.3. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:36.322Z [INFO] (Copier) variant.TensorFlowLite: stdout. Using cached numpy-2.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (13.9 MB). {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:37.239Z [INFO] (Copier) variant.TensorFlowLite: stdout. Installing collected packages: numpy, opencv-python. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
2024-10-29T10:00:58.396Z [INFO] (Copier) variant.TensorFlowLite: stdout. Successfully installed numpy-2.0.2 opencv-python-4.10.0.84. {scriptName=services.variant.TensorFlowLite.lifecycle.install.script, serviceName=variant.TensorFlowLite, currentState=NEW}
The latest IDT removes the ML aspects of the testing.
https://docs.aws.amazon.com/greengrass/v2/developerguide/dev-test-versions.html
Try using the latest versions and let us know if there is still a problem.
Relevant content
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 3 years ago

I think this answer is right. Your log suggests that you have numpy 2.0.2 installed, but the component requires 1.x.