Skip to content

Commit 868bb8e

Browse files
committed
Update python version.
1 parent 9fe7cc6 commit 868bb8e

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

tools/ci/check_validate.sh

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ function prepare_torch_env() {
3535
LOG "[INFO] Device Id: ${CUDA_VISIBLE_DEVICES}"
3636
# Update pip
3737
LOG "[INFO] Update pip ..."
38-
env http_proxy="" https_proxy="" pip install -U pip > /dev/null
38+
env http_proxy="" https_proxy="" python3.10 -m pip install -U pip > /dev/null
3939
[ $? -ne 0 ] && LOG "[FATAL] Update pip failed!" && exit -1
4040
# install torch
41-
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126 > /dev/null
41+
python3.10 -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126 > /dev/null
4242
[ $? -ne 0 ] && LOG "[FATAL] Install torch2.9.0 failed!" && exit -1
4343
else
44-
python ${GRAPH_NET_EXTRACT_WORKSPACE}/tools/count_sample.py
44+
python3.10 ${GRAPH_NET_EXTRACT_WORKSPACE}/tools/count_sample.py
4545
LOG "[INFO] This pull request doesn't change any torch samples, skip the CI."
4646
fi
4747
}
@@ -53,16 +53,16 @@ function prepare_paddle_env() {
5353
LOG "[INFO] Device Id: ${CUDA_VISIBLE_DEVICES}"
5454
# Update pip
5555
LOG "[INFO] Update pip ..."
56-
env http_proxy="" https_proxy="" pip install -U pip > /dev/null
56+
env http_proxy="" https_proxy="" python3.10 -m pip install -U pip > /dev/null
5757
[ $? -ne 0 ] && LOG "[FATAL] Update pip failed!" && exit -1
5858
# install paddle
59-
pip install astor
59+
python3.10 -m pip install astor
6060
LOG "[INFO] Install paddlepaddle-develop ..."
61-
python -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu118/ > /dev/null
61+
python3.10 -m pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu118/ > /dev/null
6262
[ $? -ne 0 ] && LOG "[FATAL] Install paddlepaddle-develop failed!" && exit -1
63-
python -c "import paddle; print('[PaddlePaddle Commit]', paddle.version.commit)"
63+
python3.10 -c "import paddle; print('[PaddlePaddle Commit]', paddle.version.commit)"
6464
else
65-
python ${GRAPH_NET_EXTRACT_WORKSPACE}/tools/count_sample.py
65+
python3.10 ${GRAPH_NET_EXTRACT_WORKSPACE}/tools/count_sample.py
6666
LOG "[INFO] This pull request doesn't change any paddle samples, skip the CI."
6767
fi
6868
}
@@ -89,7 +89,7 @@ function check_torch_validation() {
8989
fail_name=()
9090
for model_path in ${MODIFIED_MODEL_PATHS[@]}
9191
do
92-
python -m graph_net.torch.validate --model-path ${GRAPH_NET_EXTRACT_WORKSPACE}/${model_path} >&2
92+
python3.10 -m graph_net.torch.validate --model-path ${GRAPH_NET_EXTRACT_WORKSPACE}/${model_path} >&2
9393
[ $? -ne 0 ] && fail_name[${#fail_name[@]}]="${model_path}"
9494
done
9595
local failed_cnt=${#fail_name[@]}
@@ -125,7 +125,7 @@ function check_paddle_validation() {
125125
fail_name=()
126126
for model_path in ${MODIFIED_MODEL_PATHS[@]}
127127
do
128-
python -m graph_net.paddle.validate --model-path ${GRAPH_NET_EXTRACT_WORKSPACE}/${model_path} >&2
128+
python3.10 -m graph_net.paddle.validate --model-path ${GRAPH_NET_EXTRACT_WORKSPACE}/${model_path} >&2
129129
[ $? -ne 0 ] && fail_name[${#fail_name[@]}]="${model_path}"
130130
done
131131
local failed_cnt=${#fail_name[@]}
@@ -157,10 +157,8 @@ function summary_problems() {
157157

158158
function main() {
159159
check_paths_without_spaces
160-
python --version
161-
which python3.10
162-
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126
163-
python -c "import torch; print(torch.__version__)"
160+
python3.10 -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu126
161+
python3.10 -c "import torch; print(torch.__version__)"
164162
exit
165163
prepare_torch_env
166164
check_validation_info=$(check_torch_validation)
@@ -170,7 +168,7 @@ function main() {
170168
check_validation_info=$(check_paddle_validation)
171169
check_validation_code=$?
172170
summary_problems $check_validation_code "$check_validation_info"
173-
python ${GRAPH_NET_EXTRACT_WORKSPACE}/tools/count_sample.py
171+
python3.10 ${GRAPH_NET_EXTRACT_WORKSPACE}/tools/count_sample.py
174172
LOG "[INFO] check_validation run success and no error!"
175173
}
176174

0 commit comments

Comments
 (0)