Skip to content

Commit

Permalink
use packaging.version.parse(python_version) instead of list(python_ve…
Browse files Browse the repository at this point in the history
…rsion)
  • Loading branch information
lvhan028 committed Jul 29, 2022
1 parent eed5aa6 commit 57f3db2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion tools/package_tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,17 @@ MMDeploy supports
- Prepare MMDeploy dependencies

Please follow the [build-on-Linux guide](../../docs/en/01-how-to-build/linux-x86_64.md) or [build-on-Windows guide](../../docs/zh_cn/01-how-to-build/linux-x86_64.md) to install dependencies of MMDeploy,
including OpenCV, ppl.cv, ONNX Runtime and TensorRT.
including PyTorch, MMCV, OpenCV, ppl.cv, ONNX Runtime and TensorRT.

Make sure the environment variables `pplcv_DIR`, `ONNXRUNTIME_DIR`, `TENSORRT_DIR`, `CUDNN_DIR` and `CUDA_TOOLKIT_ROOT_DIR` are exported.

## Run precompiled command

- On Linux platform,

```shell
conda activate mmdeploy-3.6
pip install pyyaml
cd the/root/path/of/mmdeploy
python tools/package_tools/mmdeploy_builder.py tools/package_tools/configs/linux_x64.yaml .
```
Expand All @@ -38,6 +41,7 @@ MMDeploy supports

```shell
conda activate mmdeploy-3.6
pip install pyyaml
cd the/root/path/of/MMDeploy
python tools/package_tools/mmdeploy_builder.py tools/package_tools/configs/windows_x64.yaml .
```
Expand Down
4 changes: 3 additions & 1 deletion tools/package_tools/mmdeploy_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from typing import Dict

import yaml
from packaging import version

logger = logging.getLogger()
logger.setLevel(logging.INFO)
Expand Down Expand Up @@ -330,7 +331,8 @@ def create_package(cfg: Dict, mmdeploy_dir: str):
break

for python_version in python_versions:
python_major, _, python_minor = list(python_version)
_version = version.parse(python_version)
python_major, python_minor = _version.major, _version.minor

# create sdk python api wheel
sdk_python_package_dir = osp.join(build_dir,
Expand Down

0 comments on commit 57f3db2

Please sign in to comment.