From 7f198ffaf4c258812dee286cb5a509c7536cb4a5 Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Wed, 13 Apr 2022 18:33:42 +0800 Subject: [PATCH 1/6] docs(build): add missing build option --- docs/en/build/linux.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en/build/linux.md b/docs/en/build/linux.md index 72b2cfab7d..21989526bc 100644 --- a/docs/en/build/linux.md +++ b/docs/en/build/linux.md @@ -445,9 +445,11 @@ You can also activate other engines after the model. #### Build Demo +Take ncnn backend as example: + ```Bash cd ${MMDEPLOY_DIR}/build/install/example mkdir -p build && cd build -cmake .. -DMMDeploy_DIR=${MMDEPLOY_DIR}/build/install/lib/cmake/MMDeploy +cmake .. -DMMDeploy_DIR=${MMDEPLOY_DIR}/build/install/lib/cmake/MMDeploy -Dncnn_DIR=${NCNN_DIR}/build/install/lib/cmake/ncnn make -j$(nproc) ``` From a9e816e2ab70f43959cf02debcf3981df9fbf63e Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Thu, 14 Apr 2022 16:55:25 +0800 Subject: [PATCH 2/6] docs(build): add onnx install --- docs/en/build/linux.md | 8 ++++++++ docs/zh_cn/build/linux.md | 8 ++++++++ mmdeploy/core/rewriters/rewriter_utils.py | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/en/build/linux.md b/docs/en/build/linux.md index 21989526bc..b5865df57f 100644 --- a/docs/en/build/linux.md +++ b/docs/en/build/linux.md @@ -84,6 +84,14 @@ conda install pytorch==1.8.0 torchvision==0.9.0 cudatoolkit=11.1 -c pytorch -c c export cu_version=cu111 # cuda 11.1 export torch_version=torch1.8 pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/${cu_version}/${torch_version}/index.html + + + + + onnx + Install onnx as follows. Refer to the guide for details. +

+conda install -c conda-forge onnx
 
diff --git a/docs/zh_cn/build/linux.md b/docs/zh_cn/build/linux.md index 4dad6d5a6a..43d13e4aa3 100644 --- a/docs/zh_cn/build/linux.md +++ b/docs/zh_cn/build/linux.md @@ -81,6 +81,14 @@ conda install pytorch==1.8.0 torchvision==0.9.0 cudatoolkit=11.1 -c pytorch -c c export cu_version=cu111 # cuda 11.1 export torch_version=torch1.8 pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/${cu_version}/${torch_version}/index.html + + + + + onnx + 参考如下命令安装 onnx。更多安装方式,可查看 onnx 官网
+

+conda install -c conda-forge onnx
 
diff --git a/mmdeploy/core/rewriters/rewriter_utils.py b/mmdeploy/core/rewriters/rewriter_utils.py index a80fd84738..5d8fd8a830 100644 --- a/mmdeploy/core/rewriters/rewriter_utils.py +++ b/mmdeploy/core/rewriters/rewriter_utils.py @@ -181,7 +181,7 @@ def check(self, env: Dict) -> bool: class RewriterRegistry: - """A registry that recoreds rewrite objects. + """A registry that records rewrite objects. Logically this class is a two-dimensional table which maintains an object list for each backend. The records can be inserted to this table through @@ -304,7 +304,7 @@ def register_object(self, name (str): The import path to access the function/module. backend (str): The rewriter will be activated on which backend. ir (IR): The rewriter will be activated on which ir. - extra_chekcers (None | Checker | List[Checker]): Other requirements + extra_checkers (None | Checker | List[Checker]): Other requirements for the rewriters. Default to `None`. Returns: From f063e14d1d868456844c32b27b94d12371b7a7c3 Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Thu, 14 Apr 2022 17:54:12 +0800 Subject: [PATCH 3/6] style(doc): trim whitespace --- docs/en/build/linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/build/linux.md b/docs/en/build/linux.md index b5865df57f..bc8a52d09f 100644 --- a/docs/en/build/linux.md +++ b/docs/en/build/linux.md @@ -458,6 +458,6 @@ Take ncnn backend as example: ```Bash cd ${MMDEPLOY_DIR}/build/install/example mkdir -p build && cd build -cmake .. -DMMDeploy_DIR=${MMDEPLOY_DIR}/build/install/lib/cmake/MMDeploy -Dncnn_DIR=${NCNN_DIR}/build/install/lib/cmake/ncnn +cmake .. -DMMDeploy_DIR=${MMDEPLOY_DIR}/build/install/lib/cmake/MMDeploy -Dncnn_DIR=${NCNN_DIR}/build/install/lib/cmake/ncnn make -j$(nproc) ``` From 3574dbff7059fb973e5dc826a4592ce67b4e19c7 Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Thu, 14 Apr 2022 18:40:06 +0800 Subject: [PATCH 4/6] docs(build): revert install onnx --- docs/en/build/linux.md | 8 -------- docs/en/faq.md | 12 +++++++++++- docs/zh_cn/build/linux.md | 8 -------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/docs/en/build/linux.md b/docs/en/build/linux.md index bc8a52d09f..8141be17af 100644 --- a/docs/en/build/linux.md +++ b/docs/en/build/linux.md @@ -84,14 +84,6 @@ conda install pytorch==1.8.0 torchvision==0.9.0 cudatoolkit=11.1 -c pytorch -c c export cu_version=cu111 # cuda 11.1 export torch_version=torch1.8 pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/${cu_version}/${torch_version}/index.html - - - - - onnx - Install onnx as follows. Refer to the guide for details. -

-conda install -c conda-forge onnx
 
diff --git a/docs/en/faq.md b/docs/en/faq.md index b39042b437..14d621ea79 100644 --- a/docs/en/faq.md +++ b/docs/en/faq.md @@ -43,7 +43,17 @@ `python fixNvPe.py --input=C:\Users\user\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\lib\*.dll` You can find your pytorch installation path with: - ``` python + ```python import torch print(torch.__file__) ``` + +### Pip +- pip installed package but could not `import` them. + + Make sure your are using conda pip. + ```bash + $ which pip + # /path/to/.local/bin/pip + /path/to/miniconda3/lib/python3.9/site-packages/pip + ``` diff --git a/docs/zh_cn/build/linux.md b/docs/zh_cn/build/linux.md index 43d13e4aa3..4dad6d5a6a 100644 --- a/docs/zh_cn/build/linux.md +++ b/docs/zh_cn/build/linux.md @@ -81,14 +81,6 @@ conda install pytorch==1.8.0 torchvision==0.9.0 cudatoolkit=11.1 -c pytorch -c c export cu_version=cu111 # cuda 11.1 export torch_version=torch1.8 pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/${cu_version}/${torch_version}/index.html - - - - - onnx - 参考如下命令安装 onnx。更多安装方式,可查看 onnx 官网
-

-conda install -c conda-forge onnx
 
From c3014b7e5f5e17b79a9f61a3690d51a9d0409745 Mon Sep 17 00:00:00 2001 From: tpoisonooo Date: Thu, 14 Apr 2022 18:52:11 +0800 Subject: [PATCH 5/6] docs(build): add ncnn LD_LIBRARY_PATH --- docs/en/build/linux.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/en/build/linux.md b/docs/en/build/linux.md index 8141be17af..5b106c301e 100644 --- a/docs/en/build/linux.md +++ b/docs/en/build/linux.md @@ -235,6 +235,7 @@ Make sure to enable -DNCNN_PYTHON=ON in your build command.

 cd ncnn
 export NCNN_DIR=$(pwd)
+export LD_LIBRARY_PATH=${NCNN_DIR}/build/install/lib/cmake/ncnn:$LD_LIBRARY_PATH
 
3. Install pyncnn

@@ -445,11 +446,9 @@ You can also activate other engines after the model.
 
 #### Build Demo
 
-Take ncnn backend as example:
-
 ```Bash
 cd ${MMDEPLOY_DIR}/build/install/example
 mkdir -p build && cd build
-cmake .. -DMMDeploy_DIR=${MMDEPLOY_DIR}/build/install/lib/cmake/MMDeploy -Dncnn_DIR=${NCNN_DIR}/build/install/lib/cmake/ncnn
+cmake .. -DMMDeploy_DIR=${MMDEPLOY_DIR}/build/install/lib/cmake/MMDeploy
 make -j$(nproc)
 ```

From 3c82cefcf6f8d54c0577e44e2b83246fad40bade Mon Sep 17 00:00:00 2001
From: tpoisonooo 
Date: Thu, 14 Apr 2022 18:55:48 +0800
Subject: [PATCH 6/6] docs(build): fix path error

---
 docs/en/build/linux.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/docs/en/build/linux.md b/docs/en/build/linux.md
index 5b106c301e..318444cf3e 100644
--- a/docs/en/build/linux.md
+++ b/docs/en/build/linux.md
@@ -235,7 +235,7 @@ Make sure to enable -DNCNN_PYTHON=ON in your build command. 

 cd ncnn
 export NCNN_DIR=$(pwd)
-export LD_LIBRARY_PATH=${NCNN_DIR}/build/install/lib/cmake/ncnn:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=${NCNN_DIR}/build/install/lib/:$LD_LIBRARY_PATH
 
3. Install pyncnn