Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RunningLeon committed Aug 23, 2023
1 parent 7c7e43b commit b97b4f1
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/scripts/test_onnx2ncnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
'mmpretrain/configs/resnet/resnet18_8xb32_in1k.py',
'https://download.openmmlab.com/mmclassification/v0/resnet/resnet18_8xb32_in1k_20210831-fbbb1da6.pth', # noqa: E501
'resnet18.onnx',
'https://media.githubusercontent.com/media/tpoisonooo/mmdeploy-onnx2ncnn-testdata/main/resnet18.onnx', # noqa: E501
'https://github.com/open-mmlab/mmdeploy/releases/download/v0.1.0/resnet18.onnx', # noqa: E501
),
(
'mmpretrain/configs/mobilenet_v2/mobilenet-v2_8xb32_in1k.py',
'https://download.openmmlab.com/mmclassification/v0/mobilenet_v2/mobilenet_v2_batch256_imagenet_20200708-3b2dc3af.pth', # noqa: E501
'mobilenet-v2.onnx',
'https://media.githubusercontent.com/media/tpoisonooo/mmdeploy-onnx2ncnn-testdata/main/mobilenet-v2.onnx', # noqa: E501
'https://github.com/open-mmlab/mmdeploy/releases/download/v0.1.0/mobilenet-v2.onnx', # noqa: E501
)
]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/backend-ncnn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
export input_img=tests/data/tiger.jpeg
python3 -m mim download mmpretrain --config resnet18_8xb32_in1k --dest $work_dir
python3 tools/torch2onnx.py $deploy_cfg $model_cfg $checkpoint $input_img --work-dir $work_dir
wget https://media.githubusercontent.com/media/tpoisonooo/mmdeploy-onnx2ncnn-testdata/main/dataset.tar
wget https://github.com/open-mmlab/mmdeploy/releases/download/v0.1.0/dataset.tar
tar xvf dataset.tar
python3 tools/onnx2ncnn_quant_table.py \
--onnx $work_dir/end2end.onnx \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/backend-snpe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
sudo apt install libopencv-dev
- name: Install snpe
run: |
wget https://media.githubusercontent.com/media/tpoisonooo/mmdeploy_snpe_testdata/main/snpe-1.59.tar.gz
wget https://github.com/open-mmlab/mmdeploy/releases/download/v0.1.0/snpe-1.59.tar.gz
tar xf snpe-1.59.tar.gz
pushd snpe-1.59.0.3230
pwd
Expand Down
25 changes: 7 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,16 @@ jobs:
COLOR: ${{ steps.badge_status.conclusion == 'success' && 'green' || 'red' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build_cuda102:
build_cuda117:
runs-on: ubuntu-20.04
container:
image: pytorch/pytorch:1.9.0-cuda10.2-cudnn7-devel
image: pytorch/pytorch:2.0.0-cuda11.7-cudnn8-devel
env:
FORCE_CUDA: 1
strategy:
matrix:
torch: [1.9.0+cu102]
include:
- torch: 1.9.0+cu102
torchvision: 0.10.0+cu102
steps:
- uses: actions/checkout@v2
- name: Install system dependencies
run: |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libxrender-dev
apt-get clean
rm -rf /var/lib/apt/lists/*
Expand All @@ -170,17 +163,15 @@ jobs:
python -V
python -m pip show torch torchvision
python -m pip install --no-cache-dir --upgrade pip
python -m pip install torch==${{matrix.torch}} torchvision==${{matrix.torchvision}} -f https://download.pytorch.org/whl/torch_stable.html
- name: Install dependencies
run: |
python -V
export CFLAGS=`python -c 'import sysconfig;print("-I"+sysconfig.get_paths()["include"])'`
python -m pip install --no-cache-dir openmim
python -m pip install --no-cache-dir -r requirements.txt
python -m pip install --no-cache-dir -r requirements/backends.txt
python -m mim install "mmcv>=2.0.0rc1"
CFLAGS=$CFLAGS python -m mim install -r requirements/codebases.txt
python -m pip install --no-cache-dir -U pycuda numpy clip numba transformers
python -m mim install "mmcv>=2.0.0"
python -m pip install --no-cache-dir -r requirements/codebases.txt
python -m pip install --no-cache-dir -U pycuda numpy==1.23 clip numba transformers
python -m pip list
- name: Build and install
run: |
Expand Down Expand Up @@ -210,7 +201,6 @@ jobs:
- uses: actions/checkout@v2
- name: Install system dependencies
run: |
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libxrender-dev
apt-get clean
rm -rf /var/lib/apt/lists/*
Expand All @@ -222,12 +212,11 @@ jobs:
- name: Install dependencies
run: |
python -V
export CFLAGS=`python -c 'import sysconfig;print("-I"+sysconfig.get_paths()["include"])'`
python -m pip install --no-cache-dir openmim
python -m pip install --no-cache-dir -r requirements.txt
python -m pip install --no-cache-dir -r requirements/backends.txt
python -m mim install "mmcv>=2.0.0rc1"
python -m mim install -r requirements/codebases.txt
python -m mim install --no-cache-dir "mmcv>=2.0.0"
python -m pip install --no-cache-dir -r requirements/codebases.txt
python -m pip install --no-cache-dir -U pycuda numpy clip numba transformers
python -m pip list
- name: Build and install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/regression-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ on:
required: false
description: 'Do not change it unless you know what you are doing!'
type: string
default: 'https://8d17-103-108-182-56.ngrok-free.app'
default: 'https://e2e1-14-136-99-158.ngrok-free.app'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
4 changes: 4 additions & 0 deletions mmdeploy/codebase/mmdet3d/deploy/voxel_detection_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ def postprocess(model_cfg: Union[str, Config],
data_samples=metas, data_instances_3d=data_instances_3d)

else:
cls_score = cls_score[0]
bbox_pred = bbox_pred[0]
dir_cls_pred = dir_cls_pred[0]

pts = model_cfg.model.test_cfg.pts

rets = []
Expand Down
10 changes: 5 additions & 5 deletions tests/test_codebase/test_mmdet3d/test_voxel_detection_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ def setup_class(cls):
# simplify backend inference
cls.wrapper = SwitchBackendWrapper(ORTWrapper)
cls.outputs = {
'cls_score': torch.rand(1, 18, 32, 32),
'bbox_pred': torch.rand(1, 42, 32, 32),
'dir_cls_pred': torch.rand(1, 12, 32, 32)
'cls_score0': torch.rand(1, 18, 32, 32),
'bbox_pred0': torch.rand(1, 42, 32, 32),
'dir_cls_pred0': torch.rand(1, 12, 32, 32)
}
cls.wrapper.set(outputs=cls.outputs)
deploy_cfg = mmengine.Config({
'onnx_config': {
'input_names': ['voxels', 'num_points', 'coors'],
'output_names': ['cls_score', 'bbox_pred', 'dir_cls_pred'],
'output_names': ['cls_score0', 'bbox_pred0', 'dir_cls_pred0'],
'opset_version': 11
},
'backend_config': {
Expand Down Expand Up @@ -85,7 +85,7 @@ def test_build_voxel_detection_model():
dict(
backend_config=dict(type=Backend.ONNXRUNTIME.value),
onnx_config=dict(
output_names=['cls_score', 'bbox_pred', 'dir_cls_pred']),
output_names=['cls_score0', 'bbox_pred0', 'dir_cls_pred0']),
codebase_config=dict(type=Codebase.MMDET3D.value)))

from mmdeploy.backend.onnxruntime import ORTWrapper
Expand Down

0 comments on commit b97b4f1

Please sign in to comment.