Skip to content
Snippets Groups Projects
Unverified Commit 9865d6a5 authored by i-robot's avatar i-robot Committed by Gitee
Browse files

!3608 fix vit_base ascend eval script bug

Merge pull request !3608 from xubangduo/fixI5PEGD
parents e5827ca2 b1169efc
No related branches found
No related tags found
No related merge requests found
# Copyright 2021 Huawei Technologies Co., Ltd
# Copyright 2021-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -38,7 +38,7 @@ parser.add_argument('--sub_type', type=str, default='ViT-B_16',
choices=['ViT-B_16', 'ViT-B_32', 'ViT-L_16', 'ViT-L_32', 'ViT-H_14', 'testing'])
parser.add_argument('--checkpoint_path', type=str, default='./ckpt_0', help='checkpoint file path')
parser.add_argument('--device_target', type=str, default='GPU', help='device target Ascend or GPU. (Default: GPU)')
parser.add_argument('--id', type=int, default=0, help='device id of Ascend or GPU. (Default: 0)')
parser.add_argument('--device_id', type=int, default=0, help='device id of Ascend or GPU. (Default: 0)')
args_opt = parser.parse_args()
......@@ -64,7 +64,7 @@ if __name__ == '__main__':
context.set_context(
mode=context.GRAPH_MODE,
device_target=device_target,
device_id=args_opt.id,
device_id=args_opt.device_id,
)
dataset = create_dataset_cifar10(
......
#!/bin/bash
# Copyright 2021 Huawei Technologies Co., Ltd
# Copyright 2021-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -18,4 +18,7 @@ echo "Usage: bash ./scripts/run_standalone_eval_ascend.sh [CKPT_PATH]"
export CKPT=$1
python eval.py --checkpoint_path $CKPT > ./eval.log 2>&1 &
python eval.py \
--device_target="Ascend" \
--checkpoint_path $CKPT \
> ./eval.log 2>&1 &
#!/bin/bash
# Copyright 2021 Huawei Technologies Co., Ltd
# Copyright 2021-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
......@@ -21,6 +21,6 @@ fi
python ./eval.py \
--device_target="GPU" \
--dataset_name="$1" \
--id=$2 \
--device_id=$2 \
--checkpoint_path=$3 \
> ./eval.log 2>&1 &
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment