From d31db4fc3b9f367caba826f1d41b903f690f7ed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 26 Jul 2021 03:50:10 +0000 Subject: [PATCH 1/4] =?UTF-8?q?update=20Ascend-PyTorch=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/ONNX=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/official/cv/ReID/ReID-stro?= =?UTF-8?q?ng-baseline/ReID=5Fpth2onnx.py.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../official/cv/ReID/ReID-strong-baseline/ReID_pth2onnx.py" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/ReID_pth2onnx.py" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/ReID_pth2onnx.py" index 659451d..e60ef84 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/ReID_pth2onnx.py" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/ReID_pth2onnx.py" @@ -54,7 +54,7 @@ def main(): output_names = ["class"] dynamic_axes = {'image': {0: '-1'}, 'class': {0: '-1'}} dummy_input = torch.randn(1, 3, 256, 128) - export_onnx_file = "ReID.onnx" + export_onnx_file = "ReID_dybs.onnx" torch.onnx.export(model, dummy_input, export_onnx_file, input_names=input_names, dynamic_axes=dynamic_axes, output_names=output_names, opset_version=11, verbose=True) -- Gitee From 7cfc5cc86bff0bd6a3def9399c4e873ee951b4b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 26 Jul 2021 03:50:51 +0000 Subject: [PATCH 2/4] =?UTF-8?q?update=20Ascend-PyTorch=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/ONNX=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/official/cv/ReID/ReID-stro?= =?UTF-8?q?ng-baseline/test/pth2om.sh.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../official/cv/ReID/ReID-strong-baseline/test/pth2om.sh" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/pth2om.sh" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/pth2om.sh" index 393275a..adb8843 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/pth2om.sh" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/pth2om.sh" @@ -1,6 +1,6 @@ #!/bin/bash -rm -rf ReID.onnx +rm -rf ReID_dybs.onnx python3.7 ReID_pth2onnx.py --config_file='reid-strong-baseline/configs/softmax_triplet_with_center.yml' MODEL.PRETRAIN_CHOICE "('self')" TEST.WEIGHT "('market_resnet50_model_120_rank1_945.pth')" TEST.NECK_FEAT "('before')" TEST.FEAT_NORM "('no')" if [ $? != 0 ]; then echo "fail!" -- Gitee From a65e3b0ede21824f95201605de08af3e9b4a6af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 26 Jul 2021 03:51:30 +0000 Subject: [PATCH 3/4] =?UTF-8?q?update=20Ascend-PyTorch=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/ONNX=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/official/cv/ReID/ReID-stro?= =?UTF-8?q?ng-baseline/test/pth2om.sh.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../official/cv/ReID/ReID-strong-baseline/test/pth2om.sh" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/pth2om.sh" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/pth2om.sh" index adb8843..8033c59 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/pth2om.sh" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/pth2om.sh" @@ -9,8 +9,8 @@ fi rm -rf ReID_bs1.om ReID_bs16.om source env.sh -atc --framework=5 --model=ReID.onnx --output=ReID_bs1 --input_format=NCHW --input_shape="image:1,3,256,128" --log=debug --soc_version=Ascend310 -atc --framework=5 --model=ReID.onnx --output=ReID_bs16 --input_format=NCHW --input_shape="image:16,3,256,128" --log=debug --soc_version=Ascend310 --auto_tune_mode="RL,GA" +atc --framework=5 --model=ReID_dybs.onnx --output=ReID_bs1 --input_format=NCHW --input_shape="image:1,3,256,128" --log=debug --soc_version=Ascend310 +atc --framework=5 --model=ReID_dybs.onnx --output=ReID_bs16 --input_format=NCHW --input_shape="image:16,3,256,128" --log=debug --soc_version=Ascend310 --auto_tune_mode="RL,GA" if [ -f "ReID_bs1.om" ] && [ -f "ReID_bs16.om" ]; then echo "success" -- Gitee From ae4e2cf7df0ba05dffe82682cba30f87f53cca75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 26 Jul 2021 03:51:52 +0000 Subject: [PATCH 4/4] =?UTF-8?q?update=20Ascend-PyTorch=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/ONNX=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/official/cv/ReID/ReID-stro?= =?UTF-8?q?ng-baseline/test/aipp=5FReID=5Ftest.sh.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cv/ReID/ReID-strong-baseline/test/aipp_ReID_test.sh" | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/aipp_ReID_test.sh" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/aipp_ReID_test.sh" index a6ebcba..f9dee8b 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/aipp_ReID_test.sh" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/ONNX\346\250\241\345\236\213\346\216\250\347\220\206\346\214\207\345\257\274/official/cv/ReID/ReID-strong-baseline/test/aipp_ReID_test.sh" @@ -1,6 +1,6 @@ #! /bin/bash -atc --framework=5 --model=./ReID.onnx --input_format=NCHW --input_shape="image:1,3,256,128" --output=ReID_aipp_bs1 --log=debug --soc_version=Ascend310 --insert_op_conf=./aipp_ReID_pth.config +atc --framework=5 --model=./ReID_dybs.onnx --input_format=NCHW --input_shape="image:1,3,256,128" --output=ReID_aipp_bs1 --log=debug --soc_version=Ascend310 --insert_op_conf=./aipp_ReID_pth.config ln -s /root/datasets/market1501 ./market1501 python3.7 gen_dataset_info.py jpg ./market1501/query ./market1501_query.info -- Gitee