Closed blue-q closed 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.
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.
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
Error traceback
No response