Auto use tensorflow if cpu does not support AVX2

https://github.com/Nachtzuster/BirdNET-Pi/issues/251#issuecomment-2531452580
This commit is contained in:
Alexandre
2024-12-10 13:58:30 +01:00
committed by GitHub
parent 34fb9d700a
commit f85fdae7e3

View File

@@ -0,0 +1,12 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
set -e
# Compensate for old cpu without avx2
if lscpu | grep -q avx2; then
bashio::log.warning "NON SUPPORTED CPU DETECTED"
bashio::log.warning "Your cpu doesn't support avx2, the analyzer service will likely won't work"
bashio::log.warning "Trying to install tensorflow instead of tflite_runtime instead"
$PYTHON_VIRTUAL_ENV pip3 uninstall -y tflite_runtime
$PYTHON_VIRTUAL_ENV pip3 install tensorflow
fi