mmdeploy
mmdeploy copied to clipboard
[Fix] Fix mmcls for cifar10 config on dev-1.x
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
- Pre-commit or other linting tools are used to fix the potential lint issues.
- The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
- 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.
- The documentation has been modified accordingly, like docstring or example tutorials.
Pls rebase to dev-1.x
Pls rebase to dev-1.x
Done.
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
已放弃 (核心已转储)
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.
May merge branch dev-1.x