From 103c543a0ed6a1a796696aceb3f6c0804a1dfd85 Mon Sep 17 00:00:00 2001 From: Moe Date: Thu, 23 Jan 2020 14:14:23 -0800 Subject: [PATCH] fix tensorflow INSTALL.sh order of operations --- plugins/tensorflow/INSTALL.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/tensorflow/INSTALL.sh b/plugins/tensorflow/INSTALL.sh index 1bfa6589..2a2e8c86 100644 --- a/plugins/tensorflow/INSTALL.sh +++ b/plugins/tensorflow/INSTALL.sh @@ -6,13 +6,9 @@ echo "Getting Tensorflow Node.js module..." if [ "$nodejsinstall" = "y" ] || [ "$nodejsinstall" = "Y" ]; then npm uninstall @tensorflow/tfjs-node-gpu --unsafe-perm npm install @tensorflow/tfjs-node-gpu --unsafe-perm - sed -i 's/"tfjsBuild":"cpu"/"tfjsBuild":"gpu"/g' conf.json - sed -i 's/"tfjsBuild":"gpuORcpu"/"tfjsBuild":"gpu"/g' conf.json else npm uninstall @tensorflow/tfjs-node --unsafe-perm npm install @tensorflow/tfjs-node --unsafe-perm - sed -i 's/"tfjsBuild":"gpu"/"tfjsBuild":"cpu"/g' conf.json - sed -i 's/"tfjsBuild":"gpuORcpu"/"tfjsBuild":"cpu"/g' conf.json fi echo "Getting Coco SSD Model..." npm install @tensorflow-models/coco-ssd --unsafe-perm @@ -23,3 +19,10 @@ if [ ! -e "./conf.json" ]; then else echo "conf.json already exists..." fi +if [ "$nodejsinstall" = "y" ] || [ "$nodejsinstall" = "Y" ]; then + sed -i 's/"tfjsBuild":"cpu"/"tfjsBuild":"gpu"/g' conf.json + sed -i 's/"tfjsBuild":"gpuORcpu"/"tfjsBuild":"gpu"/g' conf.json +else + sed -i 's/"tfjsBuild":"gpu"/"tfjsBuild":"cpu"/g' conf.json + sed -i 's/"tfjsBuild":"gpuORcpu"/"tfjsBuild":"cpu"/g' conf.json +fi