Skip to content

AttributeError: 'DataContainer' object has no attribute 'shape' #32

Description

@sunstarchan

I ran the training process with following command after modifying the data_root and meta_root path only in the config file
./tools/dist_train.sh projects/configs/topomlp/topomlp_setA_r50_wo_yolov8.py 8 --work-dir=./work_dirs/topomlp_setA_r50_wo_yolov8

After 15h, it was crashed by raising the error

2024-08-26 01:11:41,259 - mmdet - INFO - Saving checkpoint at 24 epochs
Traceback (most recent call last):
  File "./tools/train.py", line 270, in <module>
    main()
  File "./tools/train.py", line 259, in main
    train_model(
  File "/usr/local/lib/python3.8/dist-packages/mmdet3d/apis/train.py", line 344, in train_model
    train_detector(
  File "/usr/local/lib/python3.8/dist-packages/mmdet3d/apis/train.py", line 319, in train_detector
    runner.run(data_loaders, cfg.workflow)
  File "/usr/local/lib/python3.8/dist-packages/mmcv/runner/epoch_based_runner.py", line 130, in run
    epoch_runner(data_loaders[i], **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/mmcv/runner/epoch_based_runner.py", line 56, in train
    self.call_hook('after_train_epoch')
  File "/usr/local/lib/python3.8/dist-packages/mmcv/runner/base_runner.py", line 309, in call_hook
    getattr(hook, fn_name)(self)
  File "/usr/local/lib/python3.8/dist-packages/mmcv/runner/hooks/evaluation.py", line 267, in after_train_epoch
    self._do_evaluate(runner)
  File "/usr/local/lib/python3.8/dist-packages/mmdet/core/evaluation/eval_hooks.py", line 126, in _do_evaluate
    results = multi_gpu_test(
  File "/usr/local/lib/python3.8/dist-packages/mmdet/apis/test.py", line 109, in multi_gpu_test
    result = model(return_loss=False, rescale=True, **data)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/parallel/distributed.py", line 1158, in forward
    output = self._run_ddp_forward(*inputs, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/parallel/distributed.py", line 1112, in _run_ddp_forward
    return module_to_run(*inputs[0], **kwargs[0])  # type: ignore[index]
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/mmcv/runner/fp16_utils.py", line 140, in new_func
    output = old_func(*new_args, **new_kwargs)
  File "/usr/local/lib/python3.8/dist-packages/mmdet3d/models/detectors/base.py", line 62, in forward
    return self.forward_test(**kwargs)
  File "/workspace/TopoMLP/projects/topomlp/models/detectors/topomlp.py", line 193, in forward_test
    outs = self.simple_forward(img, img_metas)
  File "/usr/local/lib/python3.8/dist-packages/mmcv/runner/fp16_utils.py", line 226, in new_func
    output = old_func(*new_args, **new_kwargs)
  File "/workspace/TopoMLP/projects/topomlp/models/detectors/topomlp.py", line 58, in simple_forward
    B, N, C, imH, imW = img.shape
AttributeError: 'DataContainer' object has no attribute 'shape'

The mm-related lib information was:
- mmcls==0.25.0
- mmcv-full==1.5.2
- mmdet==2.26.0
- mmsegmentation==0.29.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions