Open vansin opened 1 year ago
Can you test onnxruntime precision ?
I need to figure out which part causes precision drop, mmdeploy2onnx or onnx2ncnn .
Can you test onnxruntime precision ?
equal to 0.48303
root@d53dfc0364a7:/openmmlab/mmdeploy# python tools/test.py /openmmlab/mmdeploy/configs/mmdet/detection/detection_onnxruntime_dynamic.py /openmmlab/mmdetection/configs/yolo/yolov3_d53_8xb8-320-273e_coco.py --model "../mmdeploy_regression_working_dir/mmdet/yolov3/onnxruntime/dynamic/fp32/yolov3_d53_320_273e_coco-421362b6/end2end.onnx" --speed-test
NOTE! Installing ujson may make loading annotations faster.
11/15 08:41:03 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
11/15 08:41:03 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "mmdet_tasks" registry tree. As a workaround, the current "mmdet_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
11/15 08:41:03 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "Codebases" registry tree. As a workaround, the current "Codebases" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
11/15 08:41:03 - mmengine - WARNING - Failed to search registry with scope "mmdet" in the "backend_detectors" registry tree. As a workaround, the current "backend_detectors" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmdet" is a correct scope, or whether the registry is initialized.
11/15 08:41:03 - mmengine - INFO - Successfully loaded onnxruntime custom ops from /openmmlab/mmdeploy/mmdeploy/lib/libmmdeploy_onnxruntime_ops.so
2022-11-15 08:41:03.929254863 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1695'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929272333 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1692'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929275115 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1691'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929277659 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1690'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929279881 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1687'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929282146 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1685'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929284342 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1683'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929286556 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1682'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929288761 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1681'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929291083 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1680'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929293229 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1679'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929295457 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1678'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929297612 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1688'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929299809 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1677'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929302252 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1668'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929304494 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1674'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929307560 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1667'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929309923 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1664'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929312919 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1696'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929315817 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1663'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929318654 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1662'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929321426 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1661'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929324240 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1659'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929332313 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1656'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929334564 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1653'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929337481 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1665'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929340882 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1670'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929344102 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1666'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929347001 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1660'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929349958 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1671'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929354888 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1657'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929358117 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1669'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929361131 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1684'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929364271 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1686'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929367585 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1676'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929370877 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1693'. It is not used by any node and should be removed from the model.
2022-11-15 08:41:03.929373799 [W:onnxruntime:, graph.cc:3211 CleanUnusedInitializers] Removing initializer '1689'. It is not used by any node and should be removed from the model.
11/15 08:41:04 - mmengine - INFO -
------------------------------------------------------------
System environment:
sys.platform: linux
Python: 3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:59:51) [GCC 9.4.0]
CUDA available: True
numpy_random_seed: 85133499
GPU 0: NVIDIA GeForce GTX 1660 Ti
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 11.6, V11.6.55
GCC: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
PyTorch: 1.11.0a0+17540c5
PyTorch compiling details: PyTorch built with:
- GCC 9.3
- C++ Version: 201402
- Intel(R) Math Kernel Library Version 2019.0.5 Product Build 20190808 for Intel(R) 64 architecture applications
- Intel(R) MKL-DNN v2.3.3 (Git Hash N/A)
- OpenMP 201511 (a.k.a. OpenMP 4.5)
- LAPACK is enabled (usually provided by MKL)
- NNPACK is enabled
- CPU capability usage: AVX512
- CUDA Runtime 11.6
- NVCC architecture flags: -gencode;arch=compute_52,code=sm_52;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_86,code=compute_86
- CuDNN 8.3.2 (built against CUDA 11.5)
- Magma 2.5.2
- Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.6, CUDNN_VERSION=8.3.2, CXX_COMPILER=/usr/bin/c++, CXX_FLAGS=-fno-gnu-unique -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.11.0, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=OFF, USE_MPI=ON, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF,
TorchVision: 0.12.0a0
OpenCV: 4.5.5
MMEngine: 0.3.1
Runtime environment:
dist_cfg: {'backend': 'nccl'}
seed: None
Distributed launcher: none
Distributed training: False
GPU number: 1
------------------------------------------------------------
11/15 08:41:04 - mmengine - INFO - Config:
11/15 08:41:04 - mmengine - INFO - Result has been saved to /openmmlab/mmdeploy/work_dir/modules_statistic_results.json
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
11/15 08:41:07 - mmengine - INFO - Epoch(test) [50/126] eta: 0:00:04 time: 0.0665 data_time: 0.0013 memory: 0
11/15 08:41:10 - mmengine - INFO - Epoch(test) [100/126] eta: 0:00:01 time: 0.0715 data_time: 0.0037 memory: 0
11/15 08:41:11 - mmengine - INFO - [onnxruntime]-110 times per count: 60.93 ms, 16.41 FPS
11/15 08:41:12 - mmengine - INFO - Evaluating bbox...
Loading and preparing results...
DONE (t=0.00s)
creating index...
index created!
Running per image evaluation...
Evaluate annotation type *bbox*
DONE (t=0.51s).
Accumulating evaluation results...
DONE (t=0.27s).
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.48303
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=1000 ] = 0.78549
Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=1000 ] = 0.49975
Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.15602
Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.50076
Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.67213
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.53381
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=300 ] = 0.53381
Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=1000 ] = 0.53381
Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=1000 ] = 0.21963
Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=1000 ] = 0.54981
Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=1000 ] = 0.69946
11/15 08:41:13 - mmengine - INFO - bbox_mAP_copypaste: 0.483 0.785 0.500 0.156 0.501 0.672
11/15 08:41:13 - mmengine - INFO - Epoch(test) [126/126] coco/bbox_mAP: 0.4830 coco/bbox_mAP_50: 0.7850 coco/bbox_mAP_75: 0.5000 coco/bbox_mAP_s: 0.1560 coco/bbox_mAP_m: 0.5010 coco/bbox_mAP_l: 0.6720
cc @nihui for a yolov3 precision drop.
onnxruntime model works well.
cc @nihui for a yolov3 precision drop.
onnxruntime model works well. I test in the mini coco dataset wget https://extremevision-js-userfile.oss-cn-hangzhou.aliyuncs.com/user-25117-files/ff6429ed-0f22-4759-aa1e-f3d3f8dc4b40/coco.zip
Checklist
Describe the bug
Reproduction
Environment
Error traceback
No response