From 0b304d4a9a2737bf3715d017fb11fcbc5c0a58d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:21:40 +0000 Subject: [PATCH 01/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E8=B6=85=E5=88=86=E8=BE=A8=E7=8E=87=E6=A8=A1=E5=9E=8B=E6=A1=88?= =?UTF-8?q?=E4=BE=8B.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...216\207\346\250\241\345\236\213\346\241\210\344\276\213.md" | 3 ++- 1 file changed, 2 insertions(+), 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\350\266\205\345\210\206\350\276\250\347\216\207\346\250\241\345\236\213\346\241\210\344\276\213.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\350\266\205\345\210\206\350\276\250\347\216\207\346\250\241\345\236\213\346\241\210\344\276\213.md" index 6836f04..de89427 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\350\266\205\345\210\206\350\276\250\347\216\207\346\250\241\345\236\213\346\241\210\344\276\213.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\350\266\205\345\210\206\350\276\250\347\216\207\346\250\241\345\236\213\346\241\210\344\276\213.md" @@ -1 +1,2 @@ -[SRFlow](https://gitee.com/ascend/modelzoo/pulls/3572) \ No newline at end of file +[SRFlow](https://gitee.com/ascend/modelzoo/pulls/3572) +[Cross-Scale-Non-Local-Attention](https://gitee.com/ascend/modelzoo/pulls/4395) \ No newline at end of file -- Gitee From 858b34f3fdc3396b9f354b67bd867e1f30dbc4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:21:50 +0000 Subject: [PATCH 02/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E8=B6=85=E5=88=86=E8=BE=A8=E7=8E=87=E6=A8=A1=E5=9E=8B=E6=A1=88?= =?UTF-8?q?=E4=BE=8B.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...16\207\346\250\241\345\236\213\346\241\210\344\276\213.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\350\266\205\345\210\206\350\276\250\347\216\207\346\250\241\345\236\213\346\241\210\344\276\213.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\350\266\205\345\210\206\350\276\250\347\216\207\346\250\241\345\236\213\346\241\210\344\276\213.md" index de89427..3a02a09 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\350\266\205\345\210\206\350\276\250\347\216\207\346\250\241\345\236\213\346\241\210\344\276\213.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\350\266\205\345\210\206\350\276\250\347\216\207\346\250\241\345\236\213\346\241\210\344\276\213.md" @@ -1,2 +1,2 @@ -[SRFlow](https://gitee.com/ascend/modelzoo/pulls/3572) -[Cross-Scale-Non-Local-Attention](https://gitee.com/ascend/modelzoo/pulls/4395) \ No newline at end of file +[SRFlow](https://gitee.com/ascend/modelzoo/pulls/3572) +[Cross-Scale-Non-Local-Attention](https://gitee.com/ascend/modelzoo/pulls/4395) \ No newline at end of file -- Gitee From 389094fdba9c6ff8f010c230851e5aa67f272d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:24:47 +0000 Subject: [PATCH 03/26] =?UTF-8?q?add=20Ascend-PyTorch=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/grid=5F?= =?UTF-8?q?sample=E8=87=AA=E5=AE=9A=E4=B9=89=E7=AE=97=E5=AD=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...0\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" | 1 + 1 file changed, 1 insertion(+) create mode 100644 "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" diff --git "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" new file mode 100644 index 0000000..cb058fb --- /dev/null +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" @@ -0,0 +1 @@ +[PointRend](https://gitee.com/ascend/modelzoo/pulls/4611) \ No newline at end of file -- Gitee From eb59d744abf612d117f07d6110cb385db6e793d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:28:46 +0000 Subject: [PATCH 04/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/grid=5F?= =?UTF-8?q?sample=E8=87=AA=E5=AE=9A=E4=B9=89=E7=AE=97=E5=AD=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...252\345\256\232\344\271\211\347\256\227\345\255\220.md" | 7 ++++++- 1 file changed, 6 insertions(+), 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" index cb058fb..8a96776 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" @@ -1 +1,6 @@ -[PointRend](https://gitee.com/ascend/modelzoo/pulls/4611) \ No newline at end of file +[PointRend](https://gitee.com/ascend/modelzoo/pulls/4611) +1.从mmcv复制替换掉grid_sample的方法 +2.去除部分动态shape的where算子 +3.expand输入类型转换 +4.div输入类型转换 +5.padv3算子问题影响网络精度,通过修改代码进行了规避 \ No newline at end of file -- Gitee From 449ddd78c370d48ad4d180525956e02aa5f2f5e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:29:42 +0000 Subject: [PATCH 05/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/grid=5F?= =?UTF-8?q?sample=E8=87=AA=E5=AE=9A=E4=B9=89=E7=AE=97=E5=AD=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" index 8a96776..e6dea4f 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" @@ -1,5 +1,5 @@ [PointRend](https://gitee.com/ascend/modelzoo/pulls/4611) -1.从mmcv复制替换掉grid_sample的方法 +1.onnx不支持grid_sample算子,参考mmcv的自定义算子grid_sample的测试等价代码bilinear_grid_sample进行替换 2.去除部分动态shape的where算子 3.expand输入类型转换 4.div输入类型转换 -- Gitee From de31698d0dd4c0537500ec96b1733e2a54943196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:33:33 +0000 Subject: [PATCH 06/26] rename --- ...07\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" => "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" (100%) diff --git "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" similarity index 100% rename from "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211\347\256\227\345\255\220.md" rename to "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" -- Gitee From 396031ad7ad3440cd030ab78b3a572e6e1b7db89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:36:33 +0000 Subject: [PATCH 07/26] =?UTF-8?q?add=20Ascend-PyTorch=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E8=B7=9F=E8=B8=AASiamMask-=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E5=88=86=E6=AE=B5.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...SiamMask-\347\275\221\347\273\234\345\210\206\346\256\265.md" | 1 + 1 file changed, 1 insertion(+) create mode 100644 "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\347\233\256\346\240\207\350\267\237\350\270\252SiamMask-\347\275\221\347\273\234\345\210\206\346\256\265.md" diff --git "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\347\233\256\346\240\207\350\267\237\350\270\252SiamMask-\347\275\221\347\273\234\345\210\206\346\256\265.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\347\233\256\346\240\207\350\267\237\350\270\252SiamMask-\347\275\221\347\273\234\345\210\206\346\256\265.md" new file mode 100644 index 0000000..7053143 --- /dev/null +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\347\233\256\346\240\207\350\267\237\350\270\252SiamMask-\347\275\221\347\273\234\345\210\206\346\256\265.md" @@ -0,0 +1 @@ +[SiamMask](https://gitee.com/ascend/modelzoo/pulls/4105) \ No newline at end of file -- Gitee From 7061b09e9d48d10ff22e5bb1c70e200a36188dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:37:31 +0000 Subject: [PATCH 08/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E8=B7=9F=E8=B8=AASiamMask-=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E5=88=86=E6=AE=B5.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ask-\347\275\221\347\273\234\345\210\206\346\256\265.md" | 6 +++++- 1 file changed, 5 insertions(+), 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\347\233\256\346\240\207\350\267\237\350\270\252SiamMask-\347\275\221\347\273\234\345\210\206\346\256\265.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\347\233\256\346\240\207\350\267\237\350\270\252SiamMask-\347\275\221\347\273\234\345\210\206\346\256\265.md" index 7053143..89170d2 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\347\233\256\346\240\207\350\267\237\350\270\252SiamMask-\347\275\221\347\273\234\345\210\206\346\256\265.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\347\233\256\346\240\207\350\267\237\350\270\252SiamMask-\347\275\221\347\273\234\345\210\206\346\256\265.md" @@ -1 +1,5 @@ -[SiamMask](https://gitee.com/ascend/modelzoo/pulls/4105) \ No newline at end of file +[SiamMask](https://gitee.com/ascend/modelzoo/pulls/4105) +1.om与onnx精度一致。 +2.因为SiamMask是前后帧连续处理,即上一帧的输入作为下一帧的输出,在Refine模块中进行动态pad,因此模型需要拆分为两段。因为SiamMask部分卷积存在使用自定义kernel来对输入进行卷积操作,导致卷积存在kernel和input的双输入的情况,[issue](http://github.com/onnx/onnx-tensorrt/issues/645),故在线推理测试性能。计算的是拆分的两部分模型合在一起完整推理的性能。 +3.因为SiamMask在corr部分固定了reshape之后的形状,并且针对前后帧连续处理,所以模型不支持多batch。 +4.推理速度较慢的问题目前出在io部分。如果`msame`支持将数据从内存中读写而不必须从`.bin`文件中读写,速度将会进一步加快。 \ No newline at end of file -- Gitee From 407bb879114ce317bbf9cc38336119f34d1591ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:43:42 +0000 Subject: [PATCH 09/26] =?UTF-8?q?add=20Ascend-PyTorch=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/1.mf.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\345\212\237\350\203\275\346\211\223\351\200\232/1.mf" | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/1.mf" diff --git "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/1.mf" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/1.mf" new file mode 100644 index 0000000..c3efb1b --- /dev/null +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/1.mf" @@ -0,0 +1,7 @@ +[refinedet](https://gitee.com/ascend/modelzoo/pulls/4007) +1.直接导出onnx使用onnxsim后为空图,分段返回发现随机输入 +2.nms放在后处理,在cpu上计算 +3.onnx转om时,不能使用fp16,否则精度不达标 + ``` + --precision_mode allow_fp32_to_fp16 + ``` -- Gitee From bc56b83a7e1bfeb9977a3f7fa776901e541c80b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:44:14 +0000 Subject: [PATCH 10/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/grid=5F?= =?UTF-8?q?sample=E8=87=AA=E5=AE=9A=E4=B9=89onnx=E7=AE=97=E5=AD=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" | 3 ++- 1 file changed, 2 insertions(+), 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" index e6dea4f..760d5e1 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" @@ -3,4 +3,5 @@ 2.去除部分动态shape的where算子 3.expand输入类型转换 4.div输入类型转换 -5.padv3算子问题影响网络精度,通过修改代码进行了规避 \ No newline at end of file +5.padv3算子问题影响网络精度,通过修改代码进行了规避 +6.本模型是基于detectron2框架的模型 \ No newline at end of file -- Gitee From 0a7b46efc2b18eaaa7dd041b113f2240b0238c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:44:23 +0000 Subject: [PATCH 11/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/grid=5F?= =?UTF-8?q?sample=E8=87=AA=E5=AE=9A=E4=B9=89onnx=E7=AE=97=E5=AD=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...52\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" index 760d5e1..10b6539 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/grid_sample\350\207\252\345\256\232\344\271\211onnx\347\256\227\345\255\220.md" @@ -3,5 +3,5 @@ 2.去除部分动态shape的where算子 3.expand输入类型转换 4.div输入类型转换 -5.padv3算子问题影响网络精度,通过修改代码进行了规避 -6.本模型是基于detectron2框架的模型 \ No newline at end of file +5.padv3算子问题影响网络精度,通过修改代码进行了规避 +6.本模型是基于detectron2框架的模型 \ No newline at end of file -- Gitee From c68ea0b912449ba7c808d6a37d1a7fa42e11a38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:54:01 +0000 Subject: [PATCH 12/26] =?UTF-8?q?rename=20Ascend-PyTorch=E7=A6=BB=E7=BA=BF?= =?UTF-8?q?=E6=8E=A8=E7=90=86=E6=8C=87=E5=AF=BC/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/1.mf=20?= =?UTF-8?q?to=20Ascend-PyTorch=E7=A6=BB=E7=BA=BF=E6=8E=A8=E7=90=86?= =?UTF-8?q?=E6=8C=87=E5=AF=BC/=E4=B8=93=E9=A2=98=E6=A1=88=E4=BE=8B/?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/=E5=AF=BC=E5=87=BAonnx?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=B8=8D=E6=AD=A3=E7=A1=AE=E6=97=B6=E7=9A=84?= =?UTF-8?q?=E5=88=86=E6=9E=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/1.mf" => "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" (44%) diff --git "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/1.mf" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" similarity index 44% rename from "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/1.mf" rename to "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" index c3efb1b..77a2502 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/1.mf" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" @@ -1,7 +1,8 @@ [refinedet](https://gitee.com/ascend/modelzoo/pulls/4007) -1.直接导出onnx使用onnxsim后为空图,分段返回发现随机输入 +1.直接导出onnx使用onnxsim后为空图,分段返回导出onnx最终发现随机输入scores.size(0) == 0导致数据流为空,故导出onnx时使用真实图片作为输入 2.nms放在后处理,在cpu上计算 3.onnx转om时,不能使用fp16,否则精度不达标 ``` --precision_mode allow_fp32_to_fp16 ``` +4.常量prior_data在后处理通过代码生成,不经过模型计算 \ No newline at end of file -- Gitee From 31bd85964a06d1fd296177ddd2c44749601e9b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:54:19 +0000 Subject: [PATCH 13/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E5=AF=BC=E5=87=BAonnx=E6=A8=A1=E5=9E=8B=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE=E6=97=B6=E7=9A=84=E5=88=86=E6=9E=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" index 77a2502..61b6789 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" @@ -1,4 +1,4 @@ -[refinedet](https://gitee.com/ascend/modelzoo/pulls/4007) +[refinedet](https://gitee.com/ascend/modelzoo/pulls/4007) 1.直接导出onnx使用onnxsim后为空图,分段返回导出onnx最终发现随机输入scores.size(0) == 0导致数据流为空,故导出onnx时使用真实图片作为输入 2.nms放在后处理,在cpu上计算 3.onnx转om时,不能使用fp16,否则精度不达标 -- Gitee From 75c0dc6f7d8502b4276d870d9af33b81b37197fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:54:40 +0000 Subject: [PATCH 14/26] rename --- ...47\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" => "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" (100%) diff --git "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" similarity index 100% rename from "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" rename to "Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" -- Gitee From 2e57cf1b234e5a6a748a0f2876eda500517588b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:55:50 +0000 Subject: [PATCH 15/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84onnx=E6=A8=A1=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E6=97=B6=E7=9A=84=E5=88=86=E6=9E=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" index 61b6789..1a8d914 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" @@ -1,5 +1,5 @@ [refinedet](https://gitee.com/ascend/modelzoo/pulls/4007) -1.直接导出onnx使用onnxsim后为空图,分段返回导出onnx最终发现随机输入scores.size(0) == 0导致数据流为空,故导出onnx时使用真实图片作为输入 +1.随机输入导出的onnx使用onnxsim后为空图,分段返回导出onnx,最终发现随机输入时scores.size(0) == 0导致数据流为空,故导出onnx时使用真实图片作为输入 2.nms放在后处理,在cpu上计算 3.onnx转om时,不能使用fp16,否则精度不达标 ``` -- Gitee From bc7241d9e843fc95109d282111b70074228d75ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:56:56 +0000 Subject: [PATCH 16/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84onnx=E6=A8=A1=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E6=97=B6=E7=9A=84=E5=88=86=E6=9E=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" index 1a8d914..85f90f9 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" @@ -5,4 +5,4 @@ ``` --precision_mode allow_fp32_to_fp16 ``` -4.常量prior_data在后处理通过代码生成,不经过模型计算 \ No newline at end of file +4.常量prior_data在后处理通过代码生成,不用经过模型计算 \ No newline at end of file -- Gitee From 6ca0a1175c94142b6e65a6aeb5fae5b9dafb50a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 07:58:47 +0000 Subject: [PATCH 17/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84onnx=E6=A8=A1=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E6=97=B6=E7=9A=84=E5=88=86=E6=9E=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" index 85f90f9..9058260 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" @@ -1,6 +1,6 @@ [refinedet](https://gitee.com/ascend/modelzoo/pulls/4007) 1.随机输入导出的onnx使用onnxsim后为空图,分段返回导出onnx,最终发现随机输入时scores.size(0) == 0导致数据流为空,故导出onnx时使用真实图片作为输入 -2.nms放在后处理,在cpu上计算 +2.nms含有动态shape小算子,替换为自定义batchnms暂未通,因nms在模型最后一部分故可放在后处理 3.onnx转om时,不能使用fp16,否则精度不达标 ``` --precision_mode allow_fp32_to_fp16 -- Gitee From da05370a512b171bd8c4c89d24b7198384178677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 08:02:37 +0000 Subject: [PATCH 18/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84onnx=E6=A8=A1=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E6=97=B6=E7=9A=84=E5=88=86=E6=9E=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" index 9058260..b4d7080 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" @@ -1,5 +1,5 @@ [refinedet](https://gitee.com/ascend/modelzoo/pulls/4007) -1.随机输入导出的onnx使用onnxsim后为空图,分段返回导出onnx,最终发现随机输入时scores.size(0) == 0导致数据流为空,故导出onnx时使用真实图片作为输入 +1.随机输入导出的onnx使用onnxsim后为空图,模型分段返回导出onnx,最终发现随机输入时scores.size(0) == 0导致数据流为空,故导出onnx时使用真实图片作为输入 2.nms含有动态shape小算子,替换为自定义batchnms暂未通,因nms在模型最后一部分故可放在后处理 3.onnx转om时,不能使用fp16,否则精度不达标 ``` -- Gitee From d5879810af47ec33a96211d56831db7db2a7ee87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 08:03:02 +0000 Subject: [PATCH 19/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84onnx=E6=A8=A1=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E6=97=B6=E7=9A=84=E5=88=86=E6=9E=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" index b4d7080..37028e6 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" @@ -1,5 +1,5 @@ [refinedet](https://gitee.com/ascend/modelzoo/pulls/4007) -1.随机输入导出的onnx使用onnxsim后为空图,模型分段返回导出onnx,最终发现随机输入时scores.size(0) == 0导致数据流为空,故导出onnx时使用真实图片作为输入 +1.随机输入导出的onnx使用onnxsim后为空图,模型分段return导出onnx,最终发现随机输入时scores.size(0) == 0导致数据流为空,故导出onnx时使用真实图片作为输入 2.nms含有动态shape小算子,替换为自定义batchnms暂未通,因nms在模型最后一部分故可放在后处理 3.onnx转om时,不能使用fp16,否则精度不达标 ``` -- Gitee From 6b4b7c324b0acb201698c2c4dfc3813a8bceef14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 08:05:17 +0000 Subject: [PATCH 20/26] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20As?= =?UTF-8?q?cend-PyTorch=E7=A6=BB=E7=BA=BF=E6=8E=A8=E7=90=86=E6=8C=87?= =?UTF-8?q?=E5=AF=BC/ONNX=E6=A8=A1=E5=9E=8B=E6=8E=A8=E7=90=86=E6=8C=87?= =?UTF-8?q?=E5=AF=BC/benchmark/cv/segmentation/RefineDet.PyTorch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../benchmark/cv/segmentation/RefineDet.PyTorch" | 1 - 1 file changed, 1 deletion(-) delete mode 100644 "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/benchmark/cv/segmentation/RefineDet.PyTorch" 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/benchmark/cv/segmentation/RefineDet.PyTorch" "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/benchmark/cv/segmentation/RefineDet.PyTorch" deleted file mode 100644 index b8a24ba..0000000 --- "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/benchmark/cv/segmentation/RefineDet.PyTorch" +++ /dev/null @@ -1 +0,0 @@ -直接导出onnx使用onnxsim后为空图 \ No newline at end of file -- Gitee From f71b94e898b69814f95b3bdb95a6e384b2e2ca09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 08:06:04 +0000 Subject: [PATCH 21/26] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20As?= =?UTF-8?q?cend-PyTorch=E7=A6=BB=E7=BA=BF=E6=8E=A8=E7=90=86=E6=8C=87?= =?UTF-8?q?=E5=AF=BC/ONNX=E6=A8=A1=E5=9E=8B=E6=8E=A8=E7=90=86=E6=8C=87?= =?UTF-8?q?=E5=AF=BC/benchmark/cv/segmentation/PointRend=5Fpth2onnx.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cv/segmentation/PointRend_pth2onnx.py" | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 "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/benchmark/cv/segmentation/PointRend_pth2onnx.py" 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/benchmark/cv/segmentation/PointRend_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/benchmark/cv/segmentation/PointRend_pth2onnx.py" deleted file mode 100644 index f6588e2..0000000 --- "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/benchmark/cv/segmentation/PointRend_pth2onnx.py" +++ /dev/null @@ -1,25 +0,0 @@ -import os -import torch -from detectron2.config import get_cfg -from detectron2.projects.point_rend import add_pointrend_config -from detectron2.engine import DefaultTrainer -from detectron2.checkpoint import DetectionCheckpointer - -def setup(): - cfg = get_cfg() - add_pointrend_config(cfg) - cfg.merge_from_file(os.getcwd() + '/projects/PointRend/configs/SemanticSegmentation/pointrend_semantic_R_101_FPN_1x_cityscapes.yaml') - cfg.MODEL.DEVICE = 'cpu' - cfg.freeze() - return cfg - -cfg = setup() -model = DefaultTrainer.build_model(cfg) -DetectionCheckpointer(model, save_dir=cfg.OUTPUT_DIR).resume_or_load('./model_final_cf6ac1.pkl') -model.eval() - -input_name = ['images'] -output_name = ['results'] -dynamic_axes = {'images': {0: '-1'}, 'results': {0: '-1'}} -dummy_input = torch.randn(1, 3, 1024, 2048) -torch.onnx.export(model, dummy_input, 'pointrend.onnx', input_names=input_name, dynamic_axes=dynamic_axes, output_names=output_name, opset_version=11, verbose=True) \ No newline at end of file -- Gitee From cf65438312efd04327f30a8de20642da29b177bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 08:06:31 +0000 Subject: [PATCH 22/26] =?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/benchmark/cv/segmentation/?= =?UTF-8?q?PointRend.patch.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../benchmark/cv/segmentation/PointRend.patch" | 4 ---- 1 file changed, 4 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/benchmark/cv/segmentation/PointRend.patch" "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/benchmark/cv/segmentation/PointRend.patch" index 50a209c..30c70da 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/benchmark/cv/segmentation/PointRend.patch" +++ "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/benchmark/cv/segmentation/PointRend.patch" @@ -1,7 +1,3 @@ -1.从mmcv复制替换掉grid_sample的方法 -2.去除部分动态shape的where算子 -3.expand输入类型转换 -4.div输入类型转换 diff --git a/detectron2/modeling/meta_arch/semantic_seg.py b/detectron2/modeling/meta_arch/semantic_seg.py index 7db8410..8a08e76 100644 --- a/detectron2/modeling/meta_arch/semantic_seg.py -- Gitee From 37707452de32725721164c8c0253a5d4add00160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 08:08:10 +0000 Subject: [PATCH 23/26] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20As?= =?UTF-8?q?cend-PyTorch=E7=A6=BB=E7=BA=BF=E6=8E=A8=E7=90=86=E6=8C=87?= =?UTF-8?q?=E5=AF=BC/ONNX=E6=A8=A1=E5=9E=8B=E6=8E=A8=E7=90=86=E6=8C=87?= =?UTF-8?q?=E5=AF=BC/benchmark/cv/segmentation/PointRend.patch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cv/segmentation/PointRend.patch" | 167 ------------------ 1 file changed, 167 deletions(-) delete mode 100644 "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/benchmark/cv/segmentation/PointRend.patch" 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/benchmark/cv/segmentation/PointRend.patch" "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/benchmark/cv/segmentation/PointRend.patch" deleted file mode 100644 index 30c70da..0000000 --- "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/benchmark/cv/segmentation/PointRend.patch" +++ /dev/null @@ -1,167 +0,0 @@ -diff --git a/detectron2/modeling/meta_arch/semantic_seg.py b/detectron2/modeling/meta_arch/semantic_seg.py -index 7db8410..8a08e76 100644 ---- a/detectron2/modeling/meta_arch/semantic_seg.py -+++ b/detectron2/modeling/meta_arch/semantic_seg.py -@@ -92,10 +92,9 @@ class SemanticSegmentor(nn.Module): - The prediction has shape KxHxW that represents the logits of - each class for each pixel. - """ -- images = [x["image"].to(self.device) for x in batched_inputs] -+ '''images = [x["image"].to(self.device) for x in batched_inputs] - images = [(x - self.pixel_mean) / self.pixel_std for x in images] - images = ImageList.from_tensors(images, self.backbone.size_divisibility) -- - features = self.backbone(images.tensor) - - if "sem_seg" in batched_inputs[0]: -@@ -104,8 +103,13 @@ class SemanticSegmentor(nn.Module): - targets, self.backbone.size_divisibility, self.sem_seg_head.ignore_value - ).tensor - else: -- targets = None -+ targets = None''' -+ batched_inputs = batched_inputs.to(self.device) -+ raw_input = batched_inputs -+ features = self.backbone(raw_input) -+ targets = None - results, losses = self.sem_seg_head(features, targets) -+ return results - - if self.training: - return losses -diff --git a/projects/PointRend/point_rend/point_features.py b/projects/PointRend/point_rend/point_features.py -index 26e706e..9d1ab3b 100644 ---- a/projects/PointRend/point_rend/point_features.py -+++ b/projects/PointRend/point_rend/point_features.py -@@ -25,6 +25,88 @@ def _as_tensor(x): - return torch.as_tensor(x) - - -+def bilinear_grid_sample(im, grid, align_corners=False): -+ """Given an input and a flow-field grid, computes the output using input -+ values and pixel locations from grid. Supported only bilinear interpolation -+ method to sample the input pixels. -+ -+ Args: -+ im (torch.Tensor): Input feature map, shape (N, C, H, W) -+ grid (torch.Tensor): Point coordinates, shape (N, Hg, Wg, 2) -+ align_corners {bool}: If set to True, the extrema (-1 and 1) are -+ considered as referring to the center points of the input's -+ corner pixels. If set to False, they are instead considered as -+ referring to the corner points of the input's corner pixels, -+ making the sampling more resolution agnostic. -+ Returns: -+ torch.Tensor: A tensor with sampled points, shape (N, C, Hg, Wg) -+ """ -+ n, c, h, w = im.shape -+ gn, gh, gw, _ = grid.shape -+ assert n == gn -+ -+ x = grid[:, :, :, 0] -+ y = grid[:, :, :, 1] -+ -+ if align_corners: -+ x = ((x + 1) / 2) * (w - 1) -+ y = ((y + 1) / 2) * (h - 1) -+ else: -+ x = ((x + 1) * w - 1) / 2 -+ y = ((y + 1) * h - 1) / 2 -+ -+ x = x.view(n, -1) -+ y = y.view(n, -1) -+ -+ x0 = torch.floor(x).long() -+ y0 = torch.floor(y).long() -+ x1 = x0 + 1 -+ y1 = y0 + 1 -+ -+ wa = ((x1 - x) * (y1 - y)).unsqueeze(1) -+ wb = ((x1 - x) * (y - y0)).unsqueeze(1) -+ wc = ((x - x0) * (y1 - y)).unsqueeze(1) -+ wd = ((x - x0) * (y - y0)).unsqueeze(1) -+ -+ # Apply default for grid_sample function zero padding -+ im_padded = F.pad(im, pad=[1, 1, 1, 1], mode='constant', value=0) -+ padded_h = h + 2 -+ padded_w = w + 2 -+ # save points positions after padding -+ x0, x1, y0, y1 = x0 + 1, x1 + 1, y0 + 1, y1 + 1 -+ -+ # Clip coordinates to padded image size -+ x0 = torch.where(x0 < 0, torch.tensor(0), x0) -+ x0 = torch.where(x0 > padded_w - 1, torch.tensor(padded_w - 1), x0) -+ x1 = torch.where(x1 < 0, torch.tensor(0), x1) -+ x1 = torch.where(x1 > padded_w - 1, torch.tensor(padded_w - 1), x1) -+ y0 = torch.where(y0 < 0, torch.tensor(0), y0) -+ y0 = torch.where(y0 > padded_h - 1, torch.tensor(padded_h - 1), y0) -+ y1 = torch.where(y1 < 0, torch.tensor(0), y1) -+ y1 = torch.where(y1 > padded_h - 1, torch.tensor(padded_h - 1), y1) -+ -+ im_padded = im_padded.view(n, c, -1) -+ -+ x0_y0_tmp = (x0 + y0 * padded_w).unsqueeze(1).to(dtype=torch.int32) -+ s = torch.zeros(x0_y0_tmp.size(0), c, x0_y0_tmp.size(2)) -+ x0_y0 = x0_y0_tmp.expand_as(s).to(dtype=torch.int64) -+ x0_y1_tmp = (x0 + y1 * padded_w).unsqueeze(1).to(dtype=torch.int32) -+ s = torch.zeros(x0_y1_tmp.size(0), c, x0_y1_tmp.size(2)) -+ x0_y1 = x0_y1_tmp.expand_as(s).to(dtype=torch.int64) -+ x1_y0_tmp = (x1 + y0 * padded_w).unsqueeze(1).to(dtype=torch.int32) -+ s = torch.zeros(x1_y0_tmp.size(0), c, x1_y0_tmp.size(2)) -+ x1_y0 = x1_y0_tmp.expand_as(s).to(dtype=torch.int64) -+ x1_y1_tmp = (x1 + y1 * padded_w).unsqueeze(1).to(dtype=torch.int32) -+ s = torch.zeros(x1_y1_tmp.size(0), c, x1_y1_tmp.size(2)) -+ x1_y1 = x1_y1_tmp.expand_as(s).to(dtype=torch.int64) -+ -+ Ia = torch.gather(im_padded, 2, x0_y0) -+ Ib = torch.gather(im_padded, 2, x0_y1) -+ Ic = torch.gather(im_padded, 2, x1_y0) -+ Id = torch.gather(im_padded, 2, x1_y1) -+ -+ return (Ia * wa + Ib * wb + Ic * wc + Id * wd).reshape(n, c, gh, gw) -+ - def point_sample(input, point_coords, **kwargs): - """ - A wrapper around :function:`torch.nn.functional.grid_sample` to support 3D point_coords tensors. -@@ -44,8 +126,11 @@ def point_sample(input, point_coords, **kwargs): - add_dim = False - if point_coords.dim() == 3: - add_dim = True -- point_coords = point_coords.unsqueeze(2) -- output = F.grid_sample(input, 2.0 * point_coords - 1.0, **kwargs) -+ s = torch.zeros(point_coords.size(0), point_coords.size(1), 1, point_coords.size(2)) -+ point_coords = point_coords.reshape(point_coords.size(0), point_coords.size(1), 1, point_coords.size(2)) -+ #output = F.grid_sample(input, 2.0 * point_coords - 1.0, **kwargs) -+ # copy from mmcv -+ output = bilinear_grid_sample(input, 2.0 * point_coords - 1.0, align_corners=False) - if add_dim: - output = output.squeeze(3) - return output -@@ -147,8 +232,11 @@ def get_uncertain_point_coords_on_grid(uncertainty_map, num_points): - num_points = min(H * W, num_points) - point_indices = torch.topk(uncertainty_map.view(R, H * W), k=num_points, dim=1)[1] - point_coords = torch.zeros(R, num_points, 2, dtype=torch.float, device=uncertainty_map.device) -- point_coords[:, :, 0] = w_step / 2.0 + (point_indices % W).to(torch.float) * w_step -- point_coords[:, :, 1] = h_step / 2.0 + (point_indices // W).to(torch.float) * h_step -+ point_indices = point_indices.to(torch.int32) -+ x = w_step / 2.0 + (point_indices % W).to(torch.float) * w_step -+ y = h_step / 2.0 + (point_indices // W).to(torch.float) * h_step -+ point_coords = torch.stack([x, y], dim=-1) -+ point_indices = point_indices.to(torch.int64) - return point_indices, point_coords - - -diff --git a/projects/PointRend/point_rend/semantic_seg.py b/projects/PointRend/point_rend/semantic_seg.py -index ea65200..ba5d552 100644 ---- a/projects/PointRend/point_rend/semantic_seg.py -+++ b/projects/PointRend/point_rend/semantic_seg.py -@@ -126,7 +126,9 @@ class PointRendSemSegHead(nn.Module): - - # put sem seg point predictions to the right places on the upsampled grid. - N, C, H, W = sem_seg_logits.shape -- point_indices = point_indices.unsqueeze(1).expand(-1, C, -1) -+ point_indices = point_indices.unsqueeze(1) -+ s = torch.zeros(point_indices.size(0), C, point_indices.size(2)) -+ point_indices = point_indices.to(dtype=torch.int32).expand_as(s).to(dtype=torch.int64) - sem_seg_logits = ( - sem_seg_logits.reshape(N, C, H * W) - .scatter_(2, point_indices, point_logits) -- Gitee From 2a18c868e3229a59ecbc52b688a789614c748314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 08:09:20 +0000 Subject: [PATCH 24/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84onnx=E6=A8=A1=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E6=97=B6=E7=9A=84=E5=88=86=E6=9E=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...41\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 4 +++- 1 file changed, 3 insertions(+), 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" index 37028e6..f3431fe 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" @@ -5,4 +5,6 @@ ``` --precision_mode allow_fp32_to_fp16 ``` -4.常量prior_data在后处理通过代码生成,不用经过模型计算 \ No newline at end of file +4.常量prior_data在后处理通过代码生成,不用经过模型计算 + +附录:(https://gitee.com/wangjiangben_hw/ascend-pytorch-crowdintelligence-doc/tree/master/Ascend-PyTorch%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%8C%87%E5%AF%BC/ONNX%E6%A8%A1%E5%9E%8B%E6%8E%A8%E7%90%86%E6%8C%87%E5%AF%BC/benchmark/cv/segmentation) \ No newline at end of file -- Gitee From 89d4571f23ed06aea7f331f6f630e9a344cb8908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 08:09:39 +0000 Subject: [PATCH 25/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84onnx=E6=A8=A1=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E6=97=B6=E7=9A=84=E5=88=86=E6=9E=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" index f3431fe..67b3b8b 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" @@ -7,4 +7,4 @@ ``` 4.常量prior_data在后处理通过代码生成,不用经过模型计算 -附录:(https://gitee.com/wangjiangben_hw/ascend-pytorch-crowdintelligence-doc/tree/master/Ascend-PyTorch%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%8C%87%E5%AF%BC/ONNX%E6%A8%A1%E5%9E%8B%E6%8E%A8%E7%90%86%E6%8C%87%E5%AF%BC/benchmark/cv/segmentation) \ No newline at end of file +[学习](https://gitee.com/wangjiangben_hw/ascend-pytorch-crowdintelligence-doc/tree/master/Ascend-PyTorch%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%8C%87%E5%AF%BC/ONNX%E6%A8%A1%E5%9E%8B%E6%8E%A8%E7%90%86%E6%8C%87%E5%AF%BC/benchmark/cv/segmentation) \ No newline at end of file -- Gitee From ec93fe109cc74af4d263c9744fbc41984e776c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E4=B8=9A=E5=BA=86?= Date: Mon, 27 Sep 2021 08:10:13 +0000 Subject: [PATCH 26/26] =?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/=E4=B8=93=E9=A2=98?= =?UTF-8?q?=E6=A1=88=E4=BE=8B/=E5=8A=9F=E8=83=BD=E6=89=93=E9=80=9A/?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E7=9A=84onnx=E6=A8=A1=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E6=97=B6=E7=9A=84=E5=88=86=E6=9E=90.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" | 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/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" index 67b3b8b..e5c3ed8 100644 --- "a/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" +++ "b/Ascend-PyTorch\347\246\273\347\272\277\346\216\250\347\220\206\346\214\207\345\257\274/\344\270\223\351\242\230\346\241\210\344\276\213/\345\212\237\350\203\275\346\211\223\351\200\232/\345\257\274\345\207\272\347\232\204onnx\346\250\241\345\236\213\344\270\215\346\255\243\347\241\256\346\227\266\347\232\204\345\210\206\346\236\220.md" @@ -7,4 +7,4 @@ ``` 4.常量prior_data在后处理通过代码生成,不用经过模型计算 -[学习](https://gitee.com/wangjiangben_hw/ascend-pytorch-crowdintelligence-doc/tree/master/Ascend-PyTorch%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%8C%87%E5%AF%BC/ONNX%E6%A8%A1%E5%9E%8B%E6%8E%A8%E7%90%86%E6%8C%87%E5%AF%BC/benchmark/cv/segmentation) \ No newline at end of file +[仅供学习](https://gitee.com/wangjiangben_hw/ascend-pytorch-crowdintelligence-doc/tree/master/Ascend-PyTorch%E7%A6%BB%E7%BA%BF%E6%8E%A8%E7%90%86%E6%8C%87%E5%AF%BC/ONNX%E6%A8%A1%E5%9E%8B%E6%8E%A8%E7%90%86%E6%8C%87%E5%AF%BC/benchmark/cv/segmentation) \ No newline at end of file -- Gitee