Skip to content

Commit

Permalink
fix mmdet export
Browse files Browse the repository at this point in the history
  • Loading branch information
irexyc committed Aug 31, 2023
1 parent d9140ab commit 46d78eb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/en/01-how-to-build/macos-arm64.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ The TorchScript model is used as the IR in the conversion process of the Core ML
<td>coremltools</td>
<td>
<pre><code>
pip install coremltools==6.0b2
pip install coremltools==6.3
</code></pre>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions docs/en/05-supported-backends/coreml.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ MMDeploy support convert Pytorch model to Core ML and inference.

## Installation

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

```bash
cd ${PYTORCH_DIR}
Expand All @@ -13,7 +13,7 @@ cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_EXECUTABLE=`which python` \
-DCMAKE_INSTALL_PREFIX=install \
-DDISABLE_SVE=ON # low version like 1.8.0 of pytorch need this option
-DDISABLE_SVE=ON
make install
```

Expand Down
2 changes: 1 addition & 1 deletion docs/zh_cn/01-how-to-build/macos-arm64.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Core ML 模型的转化过程中使用 TorchScript 模型作为IR,为了支持
<td>coremltools</td>
<td>
<pre><code>
pip install coremltools==6.0b2
pip install coremltools==6.3
</code></pre>
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions docs/zh_cn/05-supported-backends/coreml.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## 安装

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

```bash
cd ${PYTORCH_DIR}
Expand All @@ -13,7 +13,7 @@ cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DPYTHON_EXECUTABLE=`which python` \
-DCMAKE_INSTALL_PREFIX=install \
-DDISABLE_SVE=ON # 低版本比如1.8.0需要加上这个参数
-DDISABLE_SVE=ON
make install
```

Expand Down
4 changes: 2 additions & 2 deletions mmdeploy/backend/coreml/ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
register_torch_op


@register_torch_op
@register_torch_op(torch_alias=["mmdeploy::coreml_nms"])

Check warning on line 8 in mmdeploy/backend/coreml/ops.py

View check run for this annotation

Codecov / codecov/patch

mmdeploy/backend/coreml/ops.py#L8

Added line #L8 was not covered by tests
def coreml_nms(context, node):
"""bind CoreML NMS op."""
inputs = _get_inputs(context, node)
Expand Down Expand Up @@ -44,7 +44,7 @@ def stack(context, node):
context.add(res)


@register_torch_op
@register_torch_op(torch_alias=["torchvision::roi_align"])

Check warning on line 47 in mmdeploy/backend/coreml/ops.py

View check run for this annotation

Codecov / codecov/patch

mmdeploy/backend/coreml/ops.py#L47

Added line #L47 was not covered by tests
def roi_align(context, node):
"""roi align."""
inputs = _get_inputs(context, node)
Expand Down

0 comments on commit 46d78eb

Please sign in to comment.