Skip to content

Commit 5479c87

Browse files
authored
fix mmdet export for coreml backend (#2392)
* fix mmdet export * fix lint
1 parent d9140ab commit 5479c87

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

docs/en/01-how-to-build/macos-arm64.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The TorchScript model is used as the IR in the conversion process of the Core ML
8787
<td>coremltools</td>
8888
<td>
8989
<pre><code>
90-
pip install coremltools==6.0b2
90+
pip install coremltools==6.3
9191
</code></pre>
9292
</td>
9393
</tr>

docs/en/05-supported-backends/coreml.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MMDeploy support convert Pytorch model to Core ML and inference.
44

55
## Installation
66

7-
To convert the model in mmdet, you need to compile libtorch to support custom operators such as nms.
7+
To convert the model in mmdet, you need to compile libtorch to support custom operators such as nms (only needed in conversion stage). For MacOS 12 users, please install Pytorch 1.8.0, for MacOS 13 users, please install Pytorch 2.0.0+.
88

99
```bash
1010
cd ${PYTORCH_DIR}
@@ -13,7 +13,7 @@ cmake .. \
1313
-DCMAKE_BUILD_TYPE=Release \
1414
-DPYTHON_EXECUTABLE=`which python` \
1515
-DCMAKE_INSTALL_PREFIX=install \
16-
-DDISABLE_SVE=ON # low version like 1.8.0 of pytorch need this option
16+
-DDISABLE_SVE=ON
1717
make install
1818
```
1919

docs/zh_cn/01-how-to-build/macos-arm64.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Core ML 模型的转化过程中使用 TorchScript 模型作为IR,为了支持
8686
<td>coremltools</td>
8787
<td>
8888
<pre><code>
89-
pip install coremltools==6.0b2
89+
pip install coremltools==6.3
9090
</code></pre>
9191
</td>
9292
</tr>

docs/zh_cn/05-supported-backends/coreml.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## 安装
66

7-
转换 mmdet 中的模型,需要编译 libtorch 支持 nms 等自定义算子
7+
转换 mmdet 中的模型,需要安装 libtorch 支持 nms 等自定义算子(仅转换,推理时不需要)。MacOS 12 的用户,请安装 Pytorch 1.8.0,MacOS 13+ 的用户,请安装 Pytorch 2.0.0+。
88

99
```bash
1010
cd ${PYTORCH_DIR}
@@ -13,7 +13,7 @@ cmake .. \
1313
-DCMAKE_BUILD_TYPE=Release \
1414
-DPYTHON_EXECUTABLE=`which python` \
1515
-DCMAKE_INSTALL_PREFIX=install \
16-
-DDISABLE_SVE=ON # 低版本比如1.8.0需要加上这个参数
16+
-DDISABLE_SVE=ON
1717
make install
1818
```
1919

mmdeploy/backend/coreml/ops.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
register_torch_op
66

77

8-
@register_torch_op
8+
@register_torch_op(torch_alias=['mmdeploy::coreml_nms'])
99
def coreml_nms(context, node):
1010
"""bind CoreML NMS op."""
1111
inputs = _get_inputs(context, node)
@@ -44,7 +44,7 @@ def stack(context, node):
4444
context.add(res)
4545

4646

47-
@register_torch_op
47+
@register_torch_op(torch_alias=['torchvision::roi_align'])
4848
def roi_align(context, node):
4949
"""roi align."""
5050
inputs = _get_inputs(context, node)

0 commit comments

Comments
 (0)