diff --git a/research/cv/vit_base/eval.py b/research/cv/vit_base/eval.py index 058c5527739a9ede7042577bab008811a21728c8..c74e23d789fbea5650ec313af988f1a1f9d51ae1 100644 --- a/research/cv/vit_base/eval.py +++ b/research/cv/vit_base/eval.py @@ -1,4 +1,4 @@ -# 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( diff --git a/research/cv/vit_base/scripts/run_standalone_eval_ascend.sh b/research/cv/vit_base/scripts/run_standalone_eval_ascend.sh index f9a09f2b3cc008423421624e7b5fab51599385ce..fa73eddeac043614ee316cbaff60cc1084bbfa5d 100644 --- a/research/cv/vit_base/scripts/run_standalone_eval_ascend.sh +++ b/research/cv/vit_base/scripts/run_standalone_eval_ascend.sh @@ -1,5 +1,5 @@ #!/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 & diff --git a/research/cv/vit_base/scripts/run_standalone_eval_gpu.sh b/research/cv/vit_base/scripts/run_standalone_eval_gpu.sh index 7010f2af5da6e5217fc0d2b6bbe707017641a702..6857ba9174b07ab9d069e3e2af96494f5a35d9d7 100644 --- a/research/cv/vit_base/scripts/run_standalone_eval_gpu.sh +++ b/research/cv/vit_base/scripts/run_standalone_eval_gpu.sh @@ -1,5 +1,5 @@ #!/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 &