Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'DataContainer' object is not subscriptable #26

Open
pawopawo opened this issue Feb 26, 2022 · 1 comment
Open

TypeError: 'DataContainer' object is not subscriptable #26

pawopawo opened this issue Feb 26, 2022 · 1 comment

Comments

@pawopawo
Copy link

pawopawo commented Feb 26, 2022

Traceback (most recent call last):
  File "train.py", line 202, in <module>
    main()
  File "train.py", line 198, in main
    meta=meta)
  File "/opt/tiger/conda/lib/python3.7/site-packages/mmdet/apis/train.py", line 170, in train_detector
    runner.run(data_loaders, cfg.workflow)
  File "/opt/tiger/conda/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 125, in run
    epoch_runner(data_loaders[i], **kwargs)
  File "/opt/tiger/conda/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 54, in train
    self.call_hook('after_train_epoch')
  File "/opt/tiger/conda/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 308, in call_hook
    getattr(hook, fn_name)(self)
  File "/opt/tiger/conda/lib/python3.7/site-packages/mmdet/core/evaluation/eval_hooks.py", line 276, in after_train_epoch
    gpu_collect=self.gpu_collect)
  File "/opt/tiger/conda/lib/python3.7/site-packages/mmdet/apis/test.py", line 97, in multi_gpu_test
    result = model(return_loss=False, rescale=True, **data)
  File "/opt/tiger/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/opt/tiger/conda/lib/python3.7/site-packages/torch/nn/parallel/distributed.py", line 705, in forward
    output = self.module(*inputs[0], **kwargs[0])
  File "/opt/tiger/conda/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/opt/tiger/conda/lib/python3.7/site-packages/mmcv/runner/fp16_utils.py", line 110, in new_func
    output = old_func(*new_args, **new_kwargs)
  File "/opt/tiger/conda/lib/python3.7/site-packages/mmdet/models/detectors/base.py", line 183, in forward
    return self.:(img, img_metas, **kwargs)
  File "/opt/tiger/conda/lib/python3.7/site-packages/mmdet/models/detectors/base.py", line 150, in forward_test
    img_meta[img_id]['batch_input_shape'] = tuple(img.size()[-2:])
TypeError: 'DataContainer' object is not subscriptable

COCO检测的时候,train没问题,但test一直有上面的bug

@cxxgtxy
Copy link
Collaborator

cxxgtxy commented Mar 3, 2022

看起来是mmdetection的版本问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants