Fix python resolution in caffe2 CI scripts
authorJunjie Bai <bai@in.tum.de>
Tue, 26 Mar 2019 03:50:49 +0000 (20:50 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 26 Mar 2019 03:56:15 +0000 (20:56 -0700)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18417

Differential Revision: D14612704

Pulled By: bddppq

fbshipit-source-id: 0942048a9c3990afc50ce73c1fa1005c4d4097aa

.jenkins/caffe2/bench.sh
.jenkins/caffe2/test.sh

index ff7b695..60cc982 100755 (executable)
@@ -14,7 +14,7 @@ else
     num_gpus=0
 fi
 
-caffe2_pypath="$(cd /usr && python -c 'import os; import caffe2; print(os.path.dirname(os.path.realpath(caffe2.__file__)))')"
+caffe2_pypath="$(cd /usr && $PYTHON -c 'import os; import caffe2; print(os.path.dirname(os.path.realpath(caffe2.__file__)))')"
 # Resnet50
 if (( $num_gpus == 0 )); then
     "$PYTHON" "$caffe2_pypath/python/examples/resnet50_trainer.py" --train_data null --batch_size 128 --epoch_size 12800 --num_epochs 2 --use_cpu
index a73bd68..ea79591 100755 (executable)
@@ -17,7 +17,7 @@ else
   # For Python builds we install into python
   # cd to /usr first so the python import doesn't get confused by any 'caffe2'
   # directory in cwd
-  python_installation="$(dirname $(dirname $(cd /usr && python -c 'import os; import caffe2; print(os.path.realpath(caffe2.__file__))')))"
+  python_installation="$(dirname $(dirname $(cd /usr && $PYTHON -c 'import os; import caffe2; print(os.path.realpath(caffe2.__file__))')))"
   caffe2_pypath="$python_installation/caffe2"
   cpp_test_dir="$python_installation/torch/test"
   ld_library_path="$python_installation/torch/lib"