Browse Source

Fix -update scripts

Lutz Roeder 7 years ago
parent
commit
a09e2c15a5
6 changed files with 18 additions and 19 deletions
  1. 5 6
      tools/caffe2-update
  2. 1 1
      tools/coreml-converter
  3. 4 4
      tools/keras-update
  4. 1 1
      tools/onnx-converter
  5. 5 6
      tools/onnx-update
  6. 2 1
      tools/update

+ 5 - 6
tools/caffe2-update

@@ -28,20 +28,19 @@ fi
 echo "Generate '../src/caffe2.js'"
 ${node_modules}/protobufjs/bin/pbjs -t static-module -w closure -r caffe2 -o ${src}/caffe2.js ${third_party}/pytorch/caffe2/proto/caffe2.proto
 
-echo "Install Caffe2 dependencies"
+echo "Install Caffe2"
+if [ "$(uname -s)" == "Darwin" ] && [ "$(which brew)" != "" ]; then
 brew bundle --file=- <<-EOS
 brew "automake"
 brew "cmake"
 brew "gflags"
 brew "glog"
 EOS
-
+fi
 export PYTHONUSERBASE=${build}/third_party/pypi/${identifier}
 export PATH=$PATH:${PYTHONUSERBASE}/bin
-
-${pip} install --user future leveldb numpy protobuf pydot python-gflags pyyaml scikit-image setuptools six
-
-echo "Build Caffe2"
+rm -rf ${PYTHONUSERBASE}
+${pip} install --user future leveldb numpy protobuf pydot python-gflags pyyaml scikit-image setuptools six hypothesis
 pushd "${third_party}/pytorch" > /dev/null
 git submodule update --init
 ${python} setup_caffe2.py develop --user

+ 1 - 1
tools/coreml-converter

@@ -25,7 +25,7 @@ fi
 
 export PYTHONUSERBASE=${build}/third_party/pypi/${identifier}
 export PATH=$PATH:${PYTHONUSERBASE}/bin
-
+rm -rf ${PYTHONUSERBASE}
 ${pip} install --quiet --user onnx
 ${pip} install --quiet --user sklearn
 ${pip} install --quiet --user ${third_party}/${identifier}

+ 4 - 4
tools/keras-update

@@ -23,11 +23,11 @@ else
     git -C "${third_party}" clone --recursive ${repository}
 fi
 
+echo "Install Keras"
 export PYTHONUSERBASE=${build}/third_party/pypi/${identifier}
-
-pushd ${third_party}/${identifier} > /dev/null
-${pip} install --user .
-popd > /dev/null
+export PATH=${PATH}:${build}/third_party/pypi/${identifier}/bin
+rm -rf ${PYTHONUSERBASE}
+${pip} install --user ${third_party}/${identifier}
 
 echo "Update '../src/keras-metadata.json'"
 pushd ${tools} > /dev/null

+ 1 - 1
tools/onnx-converter

@@ -22,7 +22,7 @@ fi
 
 export PYTHONUSERBASE=${build}/third_party/pypi/${identifier}
 export PATH=$PATH:${PYTHONUSERBASE}/bin
-
+rm -rf ${PYTHONUSERBASE}
 pip install --quiet --user ${third_party}/${identifier}
 
 python ${tools}/onnx-converter.py $@

+ 5 - 6
tools/onnx-update

@@ -25,15 +25,14 @@ else
     git -C "${third_party}" clone --recursive ${repository}
 fi
 
-export PYTHONUSERBASE=${build}/third_party/pypi/${identifier}
 
+echo "Install ONNX"
+export PYTHONUSERBASE=${build}/third_party/pypi/${identifier}
+export PATH=$PATH:${PYTHONUSERBASE}/bin
+rm -rf ${PYTHONUSERBASE}
 export ONNX_ML=1
 export ONNX_NAMESPACE=onnx
-
-echo "Build"
-pushd "${third_party}/${identifier}" > /dev/null
-${pip} install --user .
-popd > /dev/null
+${pip} install --user ${third_party}/${identifier}
 
 echo "Generate '../src/onnx-metadata.json'"
 pushd ${tools} > /dev/null

+ 2 - 1
tools/update

@@ -5,7 +5,8 @@ set -e
 # export python=python3
 # export pip=pip3
 
-tools=$(dirname ${0})
+root=$(cd $(dirname ${0})/..; pwd)
+tools=${root}/tools
 
 ${tools}/keras-update
 ${tools}/tf-update