From a729630cbfa5fe02d4b8651845f293d6c70e728f Mon Sep 17 00:00:00 2001 From: Junjie Bai Date: Mon, 25 Mar 2019 20:50:49 -0700 Subject: [PATCH] Fix python resolution in caffe2 CI scripts 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 | 2 +- .jenkins/caffe2/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.jenkins/caffe2/bench.sh b/.jenkins/caffe2/bench.sh index ff7b695..60cc982 100755 --- a/.jenkins/caffe2/bench.sh +++ b/.jenkins/caffe2/bench.sh @@ -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 diff --git a/.jenkins/caffe2/test.sh b/.jenkins/caffe2/test.sh index a73bd68..ea79591 100755 --- a/.jenkins/caffe2/test.sh +++ b/.jenkins/caffe2/test.sh @@ -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" -- 2.7.4