open-mmlab / mmdeploy

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

No such file or directory: 'data/kinetics400/kinetics400_val_list_videos.txt' #2124

Closed blue-q closed 1 year ago

blue-q commented 1 year ago

Checklist

Describe the bug

python tools/deploy.py configs/mmaction/video-recognition/video-recognition_2d_tensorrt_static-224x224.py tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb.py tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb_20220906-cd10898e.pth tests/data/arm_wrestling.mp4 --work-dir mmdeploy_models/mmaction/tsn8/ort --device cuda --show --dump-info 05/28 11:11:50 - mmengine - WARNING - Failed to search registry with scope "mmaction" 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 "mmaction" is a correct scope, or whether the registry is initialized. 05/28 11:11:50 - mmengine - WARNING - Failed to search registry with scope "mmaction" in the "mmaction_tasks" registry tree. As a workaround, the current "mmaction_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmaction" is a correct scope, or whether the registry is initialized. 05/28 11:11:50 - mmengine - WARNING - use default top-k value 1 05/28 11:11:51 - mmengine - INFO - Start pipeline mmdeploy.apis.pytorch2onnx.torch2onnx in subprocess 05/28 11:11:51 - mmengine - WARNING - Failed to search registry with scope "mmaction" 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 "mmaction" is a correct scope, or whether the registry is initialized. 05/28 11:11:51 - mmengine - WARNING - Failed to search registry with scope "mmaction" in the "mmaction_tasks" registry tree. As a workaround, the current "mmaction_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmaction" is a correct scope, or whether the registry is initialized. Loads checkpoint by local backend from path: tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb_20220906-cd10898e.pth 05/28 11:11:55 - mmengine - WARNING - DeprecationWarning: get_onnx_config will be deprecated in the future. 05/28 11:11:55 - mmengine - INFO - Export PyTorch model to ONNX: mmdeploy_models/mmaction/tsn8/ort/end2end.onnx. 05/28 11:11:55 - mmengine - WARNING - Can not find torch._C._jit_pass_onnx_autograd_function_process, function rewrite will not be applied /home/dell/miniconda3/envs/mmdeploy/lib/python3.8/site-packages/mmcv/cnn/bricks/wrappers.py:44: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if x.numel() == 0 and obsolete_torch_version(TORCH_VERSION, (1, 4)): /home/dell/qiuzx/new_mmdeploy/mmdeploy/mmdeploy/codebase/mmaction/models/recognizers/base.py:33: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). num_segs = cls_scores.shape[0] // len(data_samples) /home/dell/qiuzx/new_mmdeploy/mmaction2/mmaction/models/heads/base.py:219: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor'). cls_scores = cls_scores.view(batch_size // num_segs, num_segs, -1) 05/28 11:11:59 - mmengine - INFO - Execute onnx optimize passes. 05/28 11:12:00 - mmengine - INFO - Finish pipeline mmdeploy.apis.pytorch2onnx.torch2onnx 05/28 11:12:01 - mmengine - INFO - Start pipeline mmdeploy.apis.calibration.create_calib_input_data in subprocess 05/28 11:12:02 - mmengine - WARNING - Failed to search registry with scope "mmaction" 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 "mmaction" is a correct scope, or whether the registry is initialized. 05/28 11:12:02 - mmengine - WARNING - Failed to search registry with scope "mmaction" in the "mmaction_tasks" registry tree. As a workaround, the current "mmaction_tasks" registry in "mmdeploy" is used to build instance. This may cause unexpected failure when running the built modules. Please check whether "mmaction" is a correct scope, or whether the registry is initialized. Loads checkpoint by local backend from path: tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb_20220906-cd10898e.pth Process Process-3: Traceback (most recent call last): File "/home/dell/miniconda3/envs/mmdeploy/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 122, in build_from_cfg obj = obj_cls(**args) # type: ignore File "/home/dell/qiuzx/new_mmdeploy/mmaction2/mmaction/datasets/video_dataset.py", line 67, in init super().init( File "/home/dell/qiuzx/new_mmdeploy/mmaction2/mmaction/datasets/base.py", line 48, in init super().init( File "/home/dell/miniconda3/envs/mmdeploy/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 250, in init self.full_init() File "/home/dell/miniconda3/envs/mmdeploy/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 301, in full_init self.data_list = self.load_data_list() File "/home/dell/qiuzx/new_mmdeploy/mmaction2/mmaction/datasets/video_dataset.py", line 82, in load_data_list fin = list_from_file(self.ann_file) File "/home/dell/miniconda3/envs/mmdeploy/lib/python3.8/site-packages/mmengine/fileio/parse.py", line 60, in list_from_file text = get_text(filename, encoding, backend_args=backend_args) File "/home/dell/miniconda3/envs/mmdeploy/lib/python3.8/site-packages/mmengine/fileio/io.py", line 208, in get_text return backend.get_text(filepath, encoding) File "/home/dell/miniconda3/envs/mmdeploy/lib/python3.8/site-packages/mmengine/fileio/backends/local_backend.py", line 56, in get_text with open(filepath, encoding=encoding) as f: FileNotFoundError: [Errno 2] No such file or directory: 'data/kinetics400/kinetics400_val_list_videos.txt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/dell/miniconda3/envs/mmdeploy/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap self.run() File "/home/dell/miniconda3/envs/mmdeploy/lib/python3.8/multiprocessing/process.py", line 108, in run self._target(*self._args, self._kwargs) File "/home/dell/qiuzx/new_mmdeploy/mmdeploy/mmdeploy/apis/core/pipeline_manager.py", line 107, in call ret = func(*args, *kwargs) File "/home/dell/qiuzx/new_mmdeploy/mmdeploy/mmdeploy/apis/calibration.py", line 59, in create_calib_input_data dataset = task_processor.build_dataset(calib_dataloader['dataset']) File "/home/dell/qiuzx/new_mmdeploy/mmdeploy/mmdeploy/codebase/base/task.py", line 156, in build_dataset dataset = DATASETS.build(dataset_cfg) File "/home/dell/miniconda3/envs/mmdeploy/lib/python3.8/site-packages/mmengine/registry/registry.py", line 548, in build return self.build_func(cfg, args, kwargs, registry=self) File "/home/dell/miniconda3/envs/mmdeploy/lib/python3.8/site-packages/mmengine/registry/build_functions.py", line 144, in build_from_cfg raise type(e)( FileNotFoundError: class VideoDataset in mmaction/datasets/video_dataset.py: [Errno 2] No such file or directory: 'data/kinetics400/kinetics400_val_list_videos.txt' 05/28 11:12:05 - mmengine - ERROR - /home/dell/qiuzx/new_mmdeploy/mmdeploy/mmdeploy/apis/core/pipeline_manager.py - pop_mp_output - 80 - mmdeploy.apis.calibration.create_calib_input_data with Call id: 1 failed. exit.

Reproduction

python tools/deploy.py configs/mmaction/video-recognition/video-recognition_2d_tensorrt_static-224x224.py tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb.py tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb_20220906-cd10898e.pth tests/data/arm_wrestling.mp4 --work-dir mmdeploy_models/mmaction/tsn8/ort --device cuda --show --dump-info

video-recognition_2d_tensorrt_static-224x224.py use tensorrt-int8.py

base = ['./video-recognition_static.py', '../../base/backends/tensorrt-int8.py']

onnx_config = dict(input_shape=[224, 224])

backend_config = dict( common_config=dict(max_workspace_size=1 << 30), model_inputs=[ dict( input_shapes=dict( input=dict( min_shape=[1, 250, 3, 224, 224], opt_shape=[1, 250, 3, 224, 224], max_shape=[1, 250, 3, 224, 224]))) ])

Environment

05/28 11:03:36 - mmengine - INFO - 

05/28 11:03:36 - mmengine - INFO - **********Environmental information**********
05/28 11:03:38 - mmengine - INFO - sys.platform: linux
05/28 11:03:38 - mmengine - INFO - Python: 3.8.16 (default, Mar  2 2023, 03:21:46) [GCC 11.2.0]
05/28 11:03:38 - mmengine - INFO - CUDA available: True
05/28 11:03:38 - mmengine - INFO - numpy_random_seed: 2147483648
05/28 11:03:38 - mmengine - INFO - GPU 0,1: GeForce RTX 2080 Ti
05/28 11:03:38 - mmengine - INFO - CUDA_HOME: /usr/local/cuda
05/28 11:03:38 - mmengine - INFO - NVCC: Cuda compilation tools, release 10.2, V10.2.8
05/28 11:03:38 - mmengine - INFO - GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
05/28 11:03:38 - mmengine - INFO - PyTorch: 1.12.1
05/28 11:03:38 - mmengine - INFO - PyTorch compiling details: PyTorch built with:
  - GCC 7.3
  - C++ Version: 201402
  - Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303 for Intel(R) 64 architecture applications
  - Intel(R) MKL-DNN v2.6.0 (Git Hash 52b5f107dd9cf10910aaa19cb47f3abf9b349815)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - CUDA Runtime 10.2
  - NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-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_37,code=compute_37
  - CuDNN 7.6.5
  - Magma 2.5.2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=10.2, CUDNN_VERSION=7.6.5, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -fabi-version=11 -Wno-deprecated -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-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 -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.12.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF, 

05/28 11:03:38 - mmengine - INFO - TorchVision: 0.13.1
05/28 11:03:38 - mmengine - INFO - OpenCV: 4.7.0
05/28 11:03:38 - mmengine - INFO - MMEngine: 0.7.3
05/28 11:03:38 - mmengine - INFO - MMCV: 2.0.0
05/28 11:03:38 - mmengine - INFO - MMCV Compiler: GCC 7.3
05/28 11:03:38 - mmengine - INFO - MMCV CUDA Compiler: 10.2
05/28 11:03:38 - mmengine - INFO - MMDeploy: 1.1.0+faf05fe
05/28 11:03:38 - mmengine - INFO - 

05/28 11:03:38 - mmengine - INFO - **********Backend information**********
05/28 11:03:38 - mmengine - INFO - tensorrt:    7.2.3.4
05/28 11:03:38 - mmengine - INFO - tensorrt custom ops: Available
05/28 11:03:38 - mmengine - INFO - ONNXRuntime: None
05/28 11:03:38 - mmengine - INFO - pplnn:       None
05/28 11:03:38 - mmengine - INFO - ncnn:        None
05/28 11:03:38 - mmengine - INFO - snpe:        None
05/28 11:03:38 - mmengine - INFO - openvino:    None
05/28 11:03:38 - mmengine - INFO - torchscript: 1.12.1
05/28 11:03:38 - mmengine - INFO - torchscript custom ops:      NotAvailable
05/28 11:03:38 - mmengine - INFO - rknn-toolkit:        None
05/28 11:03:38 - mmengine - INFO - rknn-toolkit2:       None
05/28 11:03:38 - mmengine - INFO - ascend:      None
05/28 11:03:38 - mmengine - INFO - coreml:      None
05/28 11:03:38 - mmengine - INFO - tvm: None
05/28 11:03:38 - mmengine - INFO - vacc:        None
05/28 11:03:38 - mmengine - INFO - 

05/28 11:03:38 - mmengine - INFO - **********Codebase information**********
05/28 11:03:38 - mmengine - INFO - mmdet:       3.0.0
05/28 11:03:38 - mmengine - INFO - mmseg:       None
05/28 11:03:38 - mmengine - INFO - mmpretrain:  None
05/28 11:03:38 - mmengine - INFO - mmocr:       None
05/28 11:03:38 - mmengine - INFO - mmagic:      None
05/28 11:03:38 - mmengine - INFO - mmdet3d:     None
05/28 11:03:38 - mmengine - INFO - mmpose:      1.0.0
05/28 11:03:38 - mmengine - INFO - mmrotate:    None
05/28 11:03:38 - mmengine - INFO - mmaction:    1.0.0
05/28 11:03:38 - mmengine - INFO - mmrazor:     None

Error traceback

No response

irexyc commented 1 year ago

You can have a look at tools/deploy.py. If you don't provide --calib-dataset-cfg, it will use model_cfg to create calib data(https://github.com/open-mmlab/mmdeploy/blob/main/mmdeploy/apis/calibration.py#L45-L46). And tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb.py will load data from data/kinetics400/.

You can change the data settings in tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb.py. (https://github.com/open-mmlab/mmaction2/blob/main/configs/recognition/tsn/tsn_imagenet-pretrained-r50_8xb32-1x1x3-100e_kinetics400-rgb.py#L6C1-L11), modify it to a absolute path.

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.