From 68830d02e3685dbcc1fd542bbda2e9d69e189e6a Mon Sep 17 00:00:00 2001 From: aurelpec <105117622+aurelpec@users.noreply.github.com> Date: Sun, 8 May 2022 09:52:44 +0200 Subject: [PATCH] Update photoprism-install.sh Use regex to determine if CPU has avx capabilities If no avx capabilities detected swith to cpu tensorflow automatically --- setup/photoprism-install.sh | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/setup/photoprism-install.sh b/setup/photoprism-install.sh index 60fe201a..17c9a601 100644 --- a/setup/photoprism-install.sh +++ b/setup/photoprism-install.sh @@ -103,29 +103,14 @@ chown root:root /usr/local/sbin/gosu chmod 755 /usr/local/sbin/gosu msg_ok "Installed Golang" -read -p "Check For Advanced Vector Extensions? " -n 1 -r -echo -if [[ $REPLY =~ ^[Yy]$ ]] -then - check=yes -else - check=no -fi - msg_info "Installing Tensorflow" -if [ "$check" == "yes" ]; then - if [[ "$AVX" == "avx2" ]]; then - wget https://dl.photoprism.org/tensorflow/linux/libtensorflow-linux-avx2-1.15.2.tar.gz &>/dev/null - tar -C /usr/local -xzf libtensorflow-linux-avx2-1.15.2.tar.gz &>/dev/null - elif [[ "$AVX" == "avx" ]]; then - wget https://dl.photoprism.org/tensorflow/linux/libtensorflow-linux-avx-1.15.2.tar.gz &>/dev/null - tar -C /usr/local -xzf libtensorflow-linux-avx-1.15.2.tar.gz &>/dev/null - elif [[ "$AVX" == " " ]]; then - wget https://dl.photoprism.org/tensorflow/linux/libtensorflow-linux-cpu-1.15.2.tar.gz &>/dev/null - tar -C /usr/local -xzf libtensorflow-linux-cpu-1.15.2.tar.gz &>/dev/null - fi -fi -if [ "$check" == "no" ]; then +if [[ "$AVX" =~ avx2 ]]; then + wget https://dl.photoprism.org/tensorflow/linux/libtensorflow-linux-avx2-1.15.2.tar.gz &>/dev/null + tar -C /usr/local -xzf libtensorflow-linux-avx2-1.15.2.tar.gz &>/dev/null + elif [[ "$AVX" =~ avx ]]; then + wget https://dl.photoprism.org/tensorflow/linux/libtensorflow-linux-avx-1.15.2.tar.gz &>/dev/null + tar -C /usr/local -xzf libtensorflow-linux-avx-1.15.2.tar.gz &>/dev/null + else wget https://dl.photoprism.org/tensorflow/linux/libtensorflow-linux-cpu-1.15.2.tar.gz &>/dev/null tar -C /usr/local -xzf libtensorflow-linux-cpu-1.15.2.tar.gz &>/dev/null fi