diff --git a/tools/package_tools/README.md b/tools/package_tools/README.md index a8f1b1d668..5876aa38d1 100644 --- a/tools/package_tools/README.md +++ b/tools/package_tools/README.md @@ -20,7 +20,9 @@ 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 @@ -28,6 +30,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/linux_x64.yaml . ``` @@ -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 . ``` diff --git a/tools/package_tools/mmdeploy_builder.py b/tools/package_tools/mmdeploy_builder.py index 9f1f974897..9f0fae519c 100644 --- a/tools/package_tools/mmdeploy_builder.py +++ b/tools/package_tools/mmdeploy_builder.py @@ -15,6 +15,7 @@ from typing import Dict import yaml +from packaging import version logger = logging.getLogger() logger.setLevel(logging.INFO) @@ -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,