From 7328d9eeda8550ea7e03eadf183e37444a03b58a Mon Sep 17 00:00:00 2001 From: triple-Mu Date: Thu, 3 Nov 2022 16:46:36 +0800 Subject: [PATCH 1/2] Reformat --- docker/CPU/Dockerfile | 20 +++++++++----------- docker/GPU/Dockerfile | 16 ++++++++-------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/docker/CPU/Dockerfile b/docker/CPU/Dockerfile index 79aedb5f4..ec7c295b5 100644 --- a/docker/CPU/Dockerfile +++ b/docker/CPU/Dockerfile @@ -41,16 +41,17 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini ~/miniconda.sh -b -p /opt/conda && \ rm ~/miniconda.sh && \ /opt/conda/bin/conda install -y python=${PYTHON_VERSION} conda-build pyyaml numpy ipython cython typing typing_extensions mkl mkl-include ninja && \ - /opt/conda/bin/conda clean -ya + /opt/conda/bin/conda clean -ya \ + +### install open-mim +RUN /opt/conda/bin/pip install --no-cache-dir openmim + +### pytorch mmcv onnxruntme and openvino +RUN mim install torch==${TORCH_VERSION}+cpu torchvision==${TORCHVISION_VERSION}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html \ + && mim install --no-cache-dir "mmcv>=2.0.0rc1,<2.1.0" onnxruntime==${ONNXRUNTIME_VERSION} openvino-dev -### pytorch -RUN /opt/conda/bin/pip install torch==${TORCH_VERSION}+cpu torchvision==${TORCHVISION_VERSION}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html ENV PATH /opt/conda/bin:$PATH -### install open-mim mmcv -RUN /opt/conda/bin/pip install --no-cache-dir openmim \ - && mim install --no-cache-dir "mmcv>=2.0.0rc1,<2.1.0" \ - WORKDIR /root/workspace ### get onnxruntime @@ -59,9 +60,6 @@ RUN wget https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTI ENV ONNXRUNTIME_DIR=/root/workspace/onnxruntime-linux-x64-${ONNXRUNTIME_VERSION} -### install onnxruntme and openvino -RUN /opt/conda/bin/pip install onnxruntime==${ONNXRUNTIME_VERSION} openvino-dev - ### build ncnn RUN git clone https://github.com/Tencent/ncnn.git &&\ cd ncnn &&\ @@ -72,7 +70,7 @@ RUN git clone https://github.com/Tencent/ncnn.git &&\ make -j$(nproc) &&\ make install &&\ cd /root/workspace/ncnn/python &&\ - pip install -e . + mim install -e . ENV PATH="/root/workspace/ncnn/build/tools/quantize/:${PATH}" diff --git a/docker/GPU/Dockerfile b/docker/GPU/Dockerfile index bacb69407..e5d74ca62 100644 --- a/docker/GPU/Dockerfile +++ b/docker/GPU/Dockerfile @@ -34,19 +34,19 @@ RUN curl -fsSL -v -o ~/miniconda.sh -O https://repo.anaconda.com/miniconda/Mini /opt/conda/bin/conda install -y python=${PYTHON_VERSION} conda-build pyyaml numpy ipython cython typing typing_extensions mkl mkl-include ninja && \ /opt/conda/bin/conda clean -ya -### pytorch -RUN /opt/conda/bin/conda install pytorch==${TORCH_VERSION} torchvision==${TORCHVISION_VERSION} cudatoolkit=${CUDA} -c pytorch -ENV PATH /opt/conda/bin:$PATH +### install open-mim +RUN /opt/conda/bin/pip install --no-cache-dir openmim -### install mmcv -RUN /opt/conda/bin/pip install --no-cache-dir openmim \ - && mim install --no-cache-dir "mmcv>=2.0.0rc1,<2.1.0" +### pytorch mmcv onnxruntme +RUN mim install torch==${TORCH_VERSION}+cpu torchvision==${TORCHVISION_VERSION}+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html \ + && mim install --no-cache-dir "mmcv>=2.0.0rc1,<2.1.0" onnxruntime-gpu==${ONNXRUNTIME_VERSION} + +ENV PATH /opt/conda/bin:$PATH WORKDIR /root/workspace ### get onnxruntime RUN wget https://github.com/microsoft/onnxruntime/releases/download/v${ONNXRUNTIME_VERSION}/onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz \ - && tar -zxvf onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz &&\ - pip install onnxruntime-gpu==${ONNXRUNTIME_VERSION} + && tar -zxvf onnxruntime-linux-x64-${ONNXRUNTIME_VERSION}.tgz ### cp trt from pip to conda RUN cp -r /usr/local/lib/python${PYTHON_VERSION}/dist-packages/tensorrt* /opt/conda/lib/python${PYTHON_VERSION}/site-packages/ From 4bb281bfefeef63aa9f81a16c1033a042178a8d9 Mon Sep 17 00:00:00 2001 From: triple-Mu Date: Thu, 3 Nov 2022 16:48:58 +0800 Subject: [PATCH 2/2] Typo --- docker/GPU/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/GPU/Dockerfile b/docker/GPU/Dockerfile index e5d74ca62..53134d5a9 100644 --- a/docker/GPU/Dockerfile +++ b/docker/GPU/Dockerfile @@ -64,7 +64,7 @@ RUN git clone https://github.com/open-mmlab/mmdeploy &&\ cmake -DMMDEPLOY_TARGET_BACKENDS="ort;trt" .. &&\ make -j$(nproc) &&\ cd .. &&\ - mim install --no-cache-dir -e . + mim install -e . ### build sdk RUN git clone https://github.com/openppl-public/ppl.cv.git &&\