You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi all,
Hope you all are doing great,
I have a query that existing I3d codes provided in "i3d_imagenet-pretrained-r50_8xb8-32x2x1-100e_kinetics400-rgb.py" is using resnet-50. I want to use resnet-152 in place of resnet-50. I have tried to change depth=152, but getting below error:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
Hope you all are doing great,
I have a query that existing I3d codes provided in "i3d_imagenet-pretrained-r50_8xb8-32x2x1-100e_kinetics400-rgb.py" is using resnet-50. I want to use resnet-152 in place of resnet-50. I have tried to change depth=152, but getting below error:
AssertionError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/mmengine/registry/build_functions.py in build_from_cfg(cfg, registry, default_args)
121 else:
--> 122 obj = obj_cls(**args) # type: ignore
123
13 frames
/content/mmaction2/mmaction/models/backbones/resnet3d.py in init(self, depth, pretrained, stage_blocks, pretrained2d, in_channels, num_stages, base_channels, out_indices, spatial_strides, temporal_strides, dilations, conv1_kernel, conv1_stride_s, conv1_stride_t, pool1_stride_s, pool1_stride_t, with_pool1, with_pool2, style, frozen_stages, inflate, inflate_style, conv_cfg, norm_cfg, act_cfg, norm_eval, with_cp, non_local, non_local_cfg, zero_init_residual, init_cfg, kwargs)
505 planes = self.base_channels * 2i
--> 506 res_layer = self.make_res_layer(
507 self.block,
/content/mmaction2/mmaction/models/backbones/resnet3d.py in make_res_layer(block, inplanes, planes, blocks, spatial_stride, temporal_stride, dilation, style, inflate, inflate_style, non_local, non_local_cfg, norm_cfg, act_cfg, conv_cfg, with_cp, **kwargs)
594 else (non_local,) * blocks
--> 595 assert len(inflate) == blocks and len(non_local) == blocks
596 downsample = None
AssertionError:
During handling of the above exception, another exception occurred:
AssertionError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/mmengine/registry/build_functions.py in build_from_cfg(cfg, registry, default_args)
121 else:
--> 122 obj = obj_cls(**args) # type: ignore
123
/content/mmaction2/mmaction/models/recognizers/base.py in init(self, backbone, cls_head, neck, train_cfg, test_cfg, data_preprocessor)
82 else:
---> 83 self.backbone = MODELS.build(backbone)
84
/usr/local/lib/python3.10/dist-packages/mmengine/registry/registry.py in build(self, cfg, *args, **kwargs)
547 """
--> 548 return self.build_func(cfg, *args, **kwargs, registry=self)
549
/usr/local/lib/python3.10/dist-packages/mmengine/registry/build_functions.py in build_model_from_cfg(cfg, registry, default_args)
249 else:
--> 250 return build_from_cfg(cfg, registry, default_args)
251
/usr/local/lib/python3.10/dist-packages/mmengine/registry/build_functions.py in build_from_cfg(cfg, registry, default_args)
143 obj_cls.module.split('.')) # type: ignore
--> 144 raise type(e)(
145 f'class
{obj_cls.__name__}
in ' # type: ignoreAssertionError: class
ResNet3d
in mmaction/models/backbones/resnet3d.py:During handling of the above exception, another exception occurred:
AssertionError Traceback (most recent call last)
in <cell line: 9>()
7
8 # build the runner from config
----> 9 runner = Runner.from_cfg(cfg)
10
11 # start training
/usr/local/lib/python3.10/dist-packages/mmengine/runner/runner.py in from_cfg(cls, cfg)
437 """
438 cfg = copy.deepcopy(cfg)
--> 439 runner = cls(
440 model=cfg['model'],
441 work_dir=cfg['work_dir'],
/usr/local/lib/python3.10/dist-packages/mmengine/runner/runner.py in init(self, model, work_dir, train_dataloader, val_dataloader, test_dataloader, train_cfg, val_cfg, test_cfg, auto_scale_lr, optim_wrapper, param_scheduler, val_evaluator, test_evaluator, default_hooks, custom_hooks, data_preprocessor, load_from, resume, launcher, env_cfg, log_processor, log_level, visualizer, default_scope, randomness, experiment_name, cfg)
404 # Merge the data_preprocessor to model config.
405 model.setdefault('data_preprocessor', data_preprocessor)
--> 406 self.model = self.build_model(model)
407 # wrap model
408 self.model = self.wrap_model(
/usr/local/lib/python3.10/dist-packages/mmengine/runner/runner.py in build_model(self, model)
811 return model
812 elif isinstance(model, dict):
--> 813 model = MODELS.build(model)
814 return model # type: ignore
815 else:
/usr/local/lib/python3.10/dist-packages/mmengine/registry/registry.py in build(self, cfg, *args, **kwargs)
546 >>> model = MODELS.build(cfg)
547 """
--> 548 return self.build_func(cfg, *args, **kwargs, registry=self)
549
550 def _add_child(self, registry: 'Registry') -> None:
/usr/local/lib/python3.10/dist-packages/mmengine/registry/build_functions.py in build_model_from_cfg(cfg, registry, default_args)
248 return Sequential(*modules)
249 else:
--> 250 return build_from_cfg(cfg, registry, default_args)
251
252
/usr/local/lib/python3.10/dist-packages/mmengine/registry/build_functions.py in build_from_cfg(cfg, registry, default_args)
142 cls_location = '/'.join(
143 obj_cls.module.split('.')) # type: ignore
--> 144 raise type(e)(
145 f'class
{obj_cls.__name__}
in ' # type: ignore146 f'{cls_location}.py: {e}')
AssertionError: class
Recognizer3D
in mmaction/models/recognizers/recognizer3d.py: classResNet3d
in mmaction/models/backbones/resnet3d.py:Please help in this regards,
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions