open-mmlab / mmdeploy

OpenMMLab Model Deployment Framework
https://mmdeploy.readthedocs.io/en/latest/
Apache License 2.0
2.79k stars 637 forks source link

[Bug] #2458

Closed grpinto closed 1 year ago

grpinto commented 1 year ago

Checklist

Describe the bug

So the bug is, I am trying to convert a model from mmpose with mmdeploy and I have mmdeploy and mmpose in the same directory however when I perform my command, the program doesn't seem to be able to find the mmpose directory and I am not understanding why this is. I have the data inside mmpose to be able to test my quantized model but I cannot use it because my program can't find mmpose and therefore can't find the annotations

Reproduction

python mmdeploy/tools/test.py mmdeploy\configs\mmpose\pose-detection_torchscript.py mmpose\configs\wholebody_2d_keypoint\topdown_heatmap\coco-wholebody\cspnext-m_udp_8xb64-210e_coco-wholebody-256x192.py --model work_dir\end2end.pt --device cpu --speed-test

Environment

09/23 16:39:57 - mmengine - INFO - **********Environmental information**********
09/23 16:40:08 - mmengine - INFO - sys.platform: win32
09/23 16:40:08 - mmengine - INFO - Python: 3.11.4 | packaged by Anaconda, Inc. | (main, Jul  5 2023, 13:47:18) [MSC v.1916 64 bit (AMD64)]
09/23 16:40:08 - mmengine - INFO - CUDA available: False
09/23 16:40:08 - mmengine - INFO - numpy_random_seed: 2147483648
09/23 16:40:08 - mmengine - INFO - MSVC: Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30152 for x64
09/23 16:40:08 - mmengine - INFO - GCC: n/a
09/23 16:40:08 - mmengine - INFO - PyTorch: 2.0.1
09/23 16:40:08 - mmengine - INFO - PyTorch compiling details: PyTorch built with:
  - C++ Version: 199711
  - MSVC 193431937
  - Intel(R) Math Kernel Library Version 2020.0.2 Product Build 20200624 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.7.3 (Git Hash 6dbeffbae1f23cbbeae17adb7b5b13f1f37c080e)
  - OpenMP 2019
  - LAPACK is enabled (usually provided by MKL)
  - CPU capability usage: AVX2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CXX_COMPILER=C:/cb/pytorch_1000000000000/work/tmp_bin/sccache-cl.exe, CXX_FLAGS=/DWIN32 /D_WINDOWS /GR /EHsc /w /bigobj /FS -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_DISABLE_GPU_ASSERTS=OFF, TORCH_VERSION=2.0.1, USE_CUDA=0, USE_CUDNN=OFF, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=OFF, USE_NNPACK=OFF, USE_OPENMP=ON, USE_ROCM=OFF,

09/23 16:40:08 - mmengine - INFO - **********Backend information**********
09/23 16:40:08 - mmengine - INFO - tensorrt:    None
09/23 16:40:08 - mmengine - INFO - ONNXRuntime: 1.15.1
09/23 16:40:08 - mmengine - INFO - ONNXRuntime-gpu:     None
09/23 16:40:08 - mmengine - INFO - ONNXRuntime custom ops:      Available
09/23 16:40:08 - mmengine - INFO - pplnn:       None
09/23 16:40:08 - mmengine - INFO - ncnn:        None
09/23 16:40:08 - mmengine - INFO - snpe:        None
09/23 16:40:08 - mmengine - INFO - openvino:    None
09/23 16:40:08 - mmengine - INFO - torchscript: 2.0.1
09/23 16:40:08 - mmengine - INFO - torchscript custom ops:      NotAvailable
09/23 16:40:08 - mmengine - INFO - rknn-toolkit:        None
09/23 16:40:08 - mmengine - INFO - rknn-toolkit2:       None
09/23 16:40:08 - mmengine - INFO - ascend:      None
09/23 16:40:09 - mmengine - INFO - coreml:      None
09/23 16:40:09 - mmengine - INFO - tvm: None
09/23 16:40:09 - mmengine - INFO - vacc:        None
09/23 16:40:09 - mmengine - INFO -

09/23 16:40:09 - mmengine - INFO - **********Codebase information**********
09/23 16:40:09 - mmengine - INFO - mmdet:       3.1.0
09/23 16:40:09 - mmengine - INFO - mmseg:       None
09/23 16:40:09 - mmengine - INFO - mmpretrain:  1.0.2
09/23 16:40:09 - mmengine - INFO - mmocr:       None
09/23 16:40:09 - mmengine - INFO - mmagic:      None
09/23 16:40:09 - mmengine - INFO - mmdet3d:     None
09/23 16:40:09 - mmengine - INFO - mmpose:      1.1.0
09/23 16:40:09 - mmengine - INFO - mmrotate:    None
09/23 16:40:09 - mmengine - INFO - mmaction:    None
09/23 16:40:09 - mmengine - INFO - mmrazor:     None
09/23 16:40:09 - mmengine - INFO - mmyolo:      None

Error traceback

python mmdeploy/tools/test.py mmdeploy\configs\mmpose\pose-detection_onnxruntime_static.py mmpose\configs\wholebody_2d_keypoint\topdown_heatmap\coco-wholebody\cspnext-m_udp_8xb64-210e_coco-wholebody-256x192.py --model work_dir\onnx\cpsnext\end2end.onnx --device cpu --speed-test
09/23 16:23:09 - mmengine - WARNING - Failed to search registry with scope "mmpose" 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 "mmpose" is a correct scope, or whether the registry is initialized.
09/23 16:23:09 - mmengine - WARNING - Failed to search registry with scope "mmpose" in the "mmpose_tasks" registry tree. As a workaround, the current "mmpose_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmpose" is a correct scope, or whether the registry is initialized.
C:\Users\reipig1\.conda\envs\mmdeploy\Lib\site-packages\mmpose\datasets\datasets\utils.py:102: UserWarning: The metainfo config file "configs/_base_/datasets/coco_wholebody.py" does not exist. A matched config file "C:\Users\reipig1\.conda\envs\mmdeploy\Lib\site-packages\mmpose\.mim\configs\_base_\datasets\coco_wholebody.py" will be used instead.
  warnings.warn(
Traceback (most recent call last):
  File "C:\Users\reipig1\OneDrive - Aalto University\mmdeploy\tools\test.py", line 159, in <module>
    main()
  File "C:\Users\reipig1\OneDrive - Aalto University\mmdeploy\tools\test.py", line 120, in main
    dataset = task_processor.build_dataset(test_dataloader['dataset'])
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\reipig1\.conda\envs\mmdeploy\Lib\site-packages\mmdeploy\codebase\base\task.py", line 156, in build_dataset
    dataset = DATASETS.build(dataset_cfg)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\reipig1\.conda\envs\mmdeploy\Lib\site-packages\mmengine\registry\registry.py", line 570, in build
    return self.build_func(cfg, *args, **kwargs, registry=self)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\reipig1\.conda\envs\mmdeploy\Lib\site-packages\mmengine\registry\build_functions.py", line 121, in build_from_cfg
    obj = obj_cls(**args)  # type: ignore
          ^^^^^^^^^^^^^^^
  File "C:\Users\reipig1\.conda\envs\mmdeploy\Lib\site-packages\mmpose\datasets\datasets\base\base_coco_style_dataset.py", line 98, in __init__
    super().__init__(
  File "C:\Users\reipig1\.conda\envs\mmdeploy\Lib\site-packages\mmengine\dataset\base_dataset.py", line 245, in __init__
    self.full_init()
  File "C:\Users\reipig1\.conda\envs\mmdeploy\Lib\site-packages\mmengine\dataset\base_dataset.py", line 296, in full_init
    self.data_list = self.load_data_list()
                     ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\reipig1\.conda\envs\mmdeploy\Lib\site-packages\mmpose\datasets\datasets\base\base_coco_style_dataset.py", line 185, in load_data_list
    instance_list, image_list = self._load_annotations()
                                ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\reipig1\.conda\envs\mmdeploy\Lib\site-packages\mmpose\datasets\datasets\base\base_coco_style_dataset.py", line 198, in _load_annotations
    assert exists(self.ann_file), 'Annotation file does not exist'
AssertionError: Annotation file does not exist
RunningLeon commented 1 year ago

hi, as the message says, the annotation file can not be found when you are in mmdeploy directory. Maybe you could set to absolute path for the annotation file in model config

Annotation file does not exist

grpinto commented 1 year ago

I am at the main directory, I am not in mmedeploy, now I am trying to do this :

(mmdeploy) C:\Users\reipig1\binedge>python mmdeploy/tools/test.py mmdeploy\configs\mmpose\pose-detection_torchscript.py C:\Users\reipig1\binedge\mmpose\configs\wholebody_2d_keypoint\topdown_heatmap\coco-wholebody\cspnext-m_udp_8xb64-210e_coco-wholebody-256x192.py --model work_dir\end2end.pt --device cpu --speed-test

and the mistake is the same

RunningLeon commented 1 year ago

so, check the annotation file path in the model config and set it as the absolute one.

github-actions[bot] commented 1 year ago

This issue is marked as stale because it has been marked as invalid or awaiting response for 7 days without any further response. It will be closed in 5 days if the stale label is not removed or if there is no further response.

github-actions[bot] commented 1 year ago

This issue is closed because it has been stale for 5 days. Please open a new issue if you have similar issues or you have any new updates now.