mmdeploy icon indicating copy to clipboard operation
mmdeploy copied to clipboard

[Fix] Fix mmcls for cifar10 config on dev-1.x

Open hanrui1sensetime opened this issue 1 year ago • 4 comments

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily receiving feedbacks. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

deployment for mmcls model failed when use cifar10 config.

Modification

keep PackClsInput as the last of pipeline.

BC-breaking (Optional)

None.

Use cases (Optional)

python tools/deploy.py configs/mmcls/classification_onnxruntime_dynamic.py resnet18_8xb16_cifar10.py resnet18_b16x8_cifar10_20210528-bd6371c8.pth tests/data/tiger.jpeg --work-dir mmdeploy_models/mmcls/ort --device cpu

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

hanrui1sensetime avatar Sep 16 '22 03:09 hanrui1sensetime

Pls rebase to dev-1.x

AllentDan avatar Sep 16 '22 03:09 AllentDan

Pls rebase to dev-1.x

Done.

hanrui1sensetime avatar Sep 16 '22 03:09 hanrui1sensetime

converting to onnx is successful. But when I run

python demo/python/image_classification.py cpu mmdeploy_models/mmcls/ort tests/data/tiger.jpeg

It throws exception:

OpenCV Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array') in arithm_op, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/arithm.cpp, line 659
[2022-09-16 13:59:58.833] [mmdeploy] [error] [module_adapter.h:34] unhandled exception: /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/arithm.cpp:659: error: (-209) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function arithm_op

已放弃 (核心已转储)

lvhan028 avatar Sep 16 '22 06:09 lvhan028

converting to onnx is successful. But when I run

python demo/python/image_classification.py cpu mmdeploy_models/mmcls/ort tests/data/tiger.jpeg

It throws exception:

OpenCV Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array') in arithm_op, file /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/arithm.cpp, line 659
[2022-09-16 13:59:58.833] [mmdeploy] [error] [module_adapter.h:34] unhandled exception: /build/opencv-L2vuMj/opencv-3.2.0+dfsg/modules/core/src/arithm.cpp:659: error: (-209) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function arithm_op

已放弃 (核心已转储)

Done.

hanrui1sensetime avatar Sep 16 '22 11:09 hanrui1sensetime

May merge branch dev-1.x

lvhan028 avatar Sep 21 '22 10:09 lvhan028