Closed Ishihara-Masabumi closed 1 year ago
You should install mmcv rather than mmcv-lite if you need this module.
I have already installed mmcv. mmcv 2.0.1
Looks like mmcv and PyTorch versions are not compatible, please try to install mmcv with mim.
thr problem is still there, how to resolve it?
use min install solve the problem, the strange thing is that I use pip install the same version but got diffrent result
Branch
main branch (1.x version, such as
v1.0.0
, ordev-1.x
branch)Prerequisite
Environment
python 3.8 mmaction2 1.1.0 mmcv 2.0.1
Describe the bug
When I run a training script, the following error occurred.
Reproduces the problem - code sample
No response
Reproduces the problem - command or script
python tools/train.py configs/recognition/r2plus1d/r2plus1d_r34_8xb8-8x8x1-180e_kinetics400-rgb.py --seed=0 --deterministic
Reproduces the problem - error message
(openmmlab) dl@dl-machine:~/mmaction2/mmaction2$ python tools/train.py configs/recognition/r2plus1d/r2plus1d_r34_8xb8-8x8x1-180e_kinetics400-rgb.py \
Runtime environment: cudnn_benchmark: False mp_cfg: {'mp_start_method': 'fork', 'opencv_num_threads': 0} dist_cfg: {'backend': 'nccl'} seed: 0 diff_rank_seed: False deterministic: True Distributed launcher: none Distributed training: False GPU number: 1
08/01 15:50:57 - mmengine - INFO - Config: ann_file_test = 'data/kinetics400/kinetics400_val_list_videos.txt' ann_file_train = 'data/kinetics400/kinetics400_train_list_videos.txt' ann_file_val = 'data/kinetics400/kinetics400_val_list_videos.txt' auto_scale_lr = dict(base_batch_size=64, enable=False) data_root = 'data/kinetics400/videos_train' data_root_val = 'data/kinetics400/videos_val' dataset_type = 'VideoDataset' default_hooks = dict( checkpoint=dict( interval=1, max_keep_ckpts=3, save_best='auto', type='CheckpointHook'), logger=dict(ignore_last=False, interval=20, type='LoggerHook'), param_scheduler=dict(type='ParamSchedulerHook'), runtime_info=dict(type='RuntimeInfoHook'), sampler_seed=dict(type='DistSamplerSeedHook'), sync_buffers=dict(type='SyncBuffersHook'), timer=dict(type='IterTimerHook')) default_scope = 'mmaction' env_cfg = dict( cudnn_benchmark=False, dist_cfg=dict(backend='nccl'), mp_cfg=dict(mp_start_method='fork', opencv_num_threads=0)) file_client_args = dict(io_backend='disk') launcher = 'none' load_from = None log_level = 'INFO' log_processor = dict(by_epoch=True, type='LogProcessor', window_size=20) model = dict( backbone=dict( conv1_kernel=( 3, 7, 7, ), conv1_stride_t=1, conv_cfg=dict(type='Conv2plus1d'), depth=34, inflate=( 1, 1, 1, 1, ), norm_cfg=dict(eps=0.001, requires_grad=True, type='SyncBN'), norm_eval=False, pool1_stride_t=1, pretrained=None, pretrained2d=False, spatial_strides=( 1, 2, 2, 2, ), temporal_strides=( 1, 2, 2, 2, ), type='ResNet2Plus1d', zero_init_residual=False), cls_head=dict( average_clips='prob', dropout_ratio=0.5, in_channels=512, init_std=0.01, num_classes=400, spatial_type='avg', type='I3DHead'), data_preprocessor=dict( format_shape='NCTHW', mean=[ 123.675, 116.28, 103.53, ], std=[ 58.395, 57.12, 57.375, ], type='ActionDataPreprocessor'), type='Recognizer3D') optim_wrapper = dict( clip_grad=dict(max_norm=40, norm_type=2), optimizer=dict(lr=0.01, momentum=0.9, type='SGD', weight_decay=0.0001)) param_scheduler = [ dict(T_max=180, by_epoch=True, eta_min=0, type='CosineAnnealingLR'), ] randomness = dict(deterministic=True, diff_rank_seed=False, seed=0) resume = False test_cfg = dict(type='TestLoop') test_dataloader = dict( batch_size=1, dataset=dict( ann_file='data/kinetics400/kinetics400_val_list_videos.txt', data_prefix=dict(video='data/kinetics400/videos_val'), pipeline=[ dict(io_backend='disk', type='DecordInit'), dict( clip_len=8, frame_interval=8, num_clips=10, test_mode=True, type='SampleFrames'), dict(type='DecordDecode'), dict(scale=( -1, 256, ), type='Resize'), dict(crop_size=256, type='ThreeCrop'), dict(input_format='NCTHW', type='FormatShape'), dict(type='PackActionInputs'), ], test_mode=True, type='VideoDataset'), num_workers=8, persistent_workers=True, sampler=dict(shuffle=False, type='DefaultSampler')) test_evaluator = dict(type='AccMetric') test_pipeline = [ dict(io_backend='disk', type='DecordInit'), dict( clip_len=8, frame_interval=8, num_clips=10, test_mode=True, type='SampleFrames'), dict(type='DecordDecode'), dict(scale=( -1, 256, ), type='Resize'), dict(crop_size=256, type='ThreeCrop'), dict(input_format='NCTHW', type='FormatShape'), dict(type='PackActionInputs'), ] train_cfg = dict( max_epochs=180, type='EpochBasedTrainLoop', val_begin=1, val_interval=20) train_dataloader = dict( batch_size=8, dataset=dict( ann_file='data/kinetics400/kinetics400_train_list_videos.txt', data_prefix=dict(video='data/kinetics400/videos_train'), pipeline=[ dict(io_backend='disk', type='DecordInit'), dict( clip_len=8, frame_interval=8, num_clips=1, type='SampleFrames'), dict(type='DecordDecode'), dict(scale=( -1, 256, ), type='Resize'), dict(type='RandomResizedCrop'), dict(keep_ratio=False, scale=( 224, 224, ), type='Resize'), dict(flip_ratio=0.5, type='Flip'), dict(input_format='NCTHW', type='FormatShape'), dict(type='PackActionInputs'), ], type='VideoDataset'), num_workers=8, persistent_workers=True, sampler=dict(shuffle=True, type='DefaultSampler')) train_pipeline = [ dict(io_backend='disk', type='DecordInit'), dict(clip_len=8, frame_interval=8, num_clips=1, type='SampleFrames'), dict(type='DecordDecode'), dict(scale=( -1, 256, ), type='Resize'), dict(type='RandomResizedCrop'), dict(keep_ratio=False, scale=( 224, 224, ), type='Resize'), dict(flip_ratio=0.5, type='Flip'), dict(input_format='NCTHW', type='FormatShape'), dict(type='PackActionInputs'), ] val_cfg = dict(type='ValLoop') val_dataloader = dict( batch_size=8, dataset=dict( ann_file='data/kinetics400/kinetics400_val_list_videos.txt', data_prefix=dict(video='data/kinetics400/videos_val'), pipeline=[ dict(io_backend='disk', type='DecordInit'), dict( clip_len=8, frame_interval=8, num_clips=1, test_mode=True, type='SampleFrames'), dict(type='DecordDecode'), dict(scale=( -1, 256, ), type='Resize'), dict(crop_size=224, type='CenterCrop'), dict(input_format='NCTHW', type='FormatShape'), dict(type='PackActionInputs'), ], test_mode=True, type='VideoDataset'), num_workers=8, persistent_workers=True, sampler=dict(shuffle=False, type='DefaultSampler')) val_evaluator = dict(type='AccMetric') val_pipeline = [ dict(io_backend='disk', type='DecordInit'), dict( clip_len=8, frame_interval=8, num_clips=1, test_mode=True, type='SampleFrames'), dict(type='DecordDecode'), dict(scale=( -1, 256, ), type='Resize'), dict(crop_size=224, type='CenterCrop'), dict(input_format='NCTHW', type='FormatShape'), dict(type='PackActionInputs'), ] vis_backends = [ dict(type='LocalVisBackend'), ] visualizer = dict( type='ActionVisualizer', vis_backends=[ dict(type='LocalVisBackend'), ]) work_dir = './work_dirs/r2plus1d_r34_8xb8-8x8x1-180e_kinetics400-rgb'
/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/cnn/bricks/transformer.py:33: UserWarning: Fail to import
main()
File "tools/train.py", line 128, in main
runner = Runner.from_cfg(cfg)
File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/runner/runner.py", line 445, in from_cfg
runner = cls(
File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/runner/runner.py", line 414, in init
self.model = self.wrap_model(
File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/runner/runner.py", line 864, in wrap_model
model = revert_sync_batchnorm(model)
File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmengine/model/utils.py", line 174, in revert_sync_batchnorm
from mmcv.ops import SyncBatchNorm
File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/ops/init.py", line 2, in
from .active_rotated_filter import active_rotated_filter
File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/ops/active_rotated_filter.py", line 10, in
ext_module = ext_loader.load_ext(
File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
File "/home/dl/miniconda3/envs/openmmlab/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: /home/dl/miniconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/_ext.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZN3c104impl8GPUTrace13gpuTraceStateE
MultiScaleDeformableAttention
frommmcv.ops.multi_scale_deform_attn
, You should installmmcv
rather thanmmcv-lite
if you need this module. warnings.warn('Fail to importMultiScaleDeformableAttention
from ' 08/01 15:51:01 - mmengine - INFO - Distributed training is not used, all SyncBatchNorm (SyncBN) layers in the model will be automatically reverted to BatchNormXd layers if they are used. Traceback (most recent call last): File "tools/train.py", line 135, inAdditional information
No response