-
Notifications
You must be signed in to change notification settings - Fork 43
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
Validaiton| TypeError: 'DataContainer' object is not subscriptable #14
Comments
You can debug it to see what the format of |
Thanks for your reply! The format of
I also tried I think this is a similar problem as #https://github.com/open-mmlab/mmdetection/issues/1501 But I do run this code on a GPU environment. I have never met this problem when I training with two-stage detectors using mmdetection. |
I've met similar problem, and I think you can try these solutions, which may be useful:
Hope these can help you. (It's a pity that I cannot debug these days.) |
Thank you so much! |
你好,我这个之前也报这个错误,然后我也改了,为什么还是有TypeError: 'DataContainer' object is not subscriptable问题 |
你好,请提供你的输出日志,以及对应的 Hello, please provide your output log, and the corresponding |
我在终端输入python tools/train.py configs/MIAOD.py 运行没有问题,但是输入./script.sh 0时就有问题了 |
请提供你的输出日志。 Please provide your output log. |
[ ] 0/4952, elapsed: 0s, ETA:Traceback (most recent call last):
File "./tools/train.py", line 257, in <module>
main()
File "./tools/train.py", line 232, in main
distributed=distributed, validate=args.no_validate, timestamp=timestamp, meta=meta)
File "/home/liugh/MI-AOD-master/mmdet/apis/train.py", line 120, in train_detector
runner.run(data_loaders_L, cfg.workflow, cfg.total_epochs)
File "/home/liugh/.conda/envs/miaod/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 161, in run
epoch_runner(data_loaders[i], **kwargs)
File "/home/liugh/.conda/envs/miaod/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 43, in train
self.call_hook('after_train_epoch')
File "/home/liugh/.conda/envs/miaod/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 298, in call_hook
getattr(hook, fn_name)(self)
File "/home/liugh/MI-AOD-master/mmdet/core/evaluation/eval_hooks.py", line 71, in after_train_epoch
gpu_collect=self.gpu_collect)
File "/home/liugh/MI-AOD-master/mmdet/apis/test.py", line 85, in multi_gpu_test
y_head = model(return_loss=False, rescale=True, **data)
File "/home/liugh/.conda/envs/miaod/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/liugh/.conda/envs/miaod/lib/python3.7/site-packages/torch/nn/parallel/distributed.py", line 705, in forward
output = self.module(*inputs[0], **kwargs[0])
File "/home/liugh/.conda/envs/miaod/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/liugh/MI-AOD-master/mmdet/core/fp16/decorators.py", line 51, in new_func
return old_func(*args, **kwargs)
File "/home/liugh/MI-AOD-master/mmdet/models/detectors/base.py", line 164, in forward
return self.forward_test(x, img_metas, return_box=return_box, **kwargs)
File "/home/liugh/MI-AOD-master/mmdet/models/detectors/base.py", line 144, in forward_test
return self.simple_test(imgs[0], img_metas[0], return_box=return_box, **kwargs)
File "/home/liugh/MI-AOD-master/mmdet/models/detectors/single_stage.py", line 109, in simple_test
y_head_loc_cls = self.bbox_head.get_bboxes(*outs, img_metas, rescale=rescale)
File "/home/liugh/MI-AOD-master/mmdet/core/fp16/decorators.py", line 131, in new_func
return old_func(*args, **kwargs)
File "/home/liugh/MI-AOD-master/mmdet/models/dense_heads/MIAOD_head.py", line 636, in get_bboxes
img_shape = img_metas[img_id]['img_shape']
TypeError: 'DataContainer' object does not support indexing
这是./script.sh 0的结果,
然后在使用python直接运行的时候已经出了1k的结果了
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 4952/4952, 74.0 task/s, elapsed: 67s, ETA: 0s2022-04-20 15:41:02,700 - mmdet - INFO -
+-------------+------+-------+--------+-------+
| class | gts | dets | recall | ap |
+-------------+------+-------+--------+-------+
| aeroplane | 285 | 923 | 0.779 | 0.663 |
| bicycle | 337 | 1090 | 0.742 | 0.612 |
| bird | 459 | 2388 | 0.643 | 0.471 |
| boat | 263 | 1780 | 0.673 | 0.422 |
| bottle | 469 | 3348 | 0.422 | 0.217 |
| bus | 213 | 997 | 0.836 | 0.668 |
| car | 1201 | 4420 | 0.839 | 0.727 |
| cat | 358 | 1036 | 0.782 | 0.643 |
| chair | 756 | 6845 | 0.663 | 0.372 |
| cow | 244 | 1157 | 0.738 | 0.404 |
| diningtable | 206 | 1333 | 0.772 | 0.568 |
| dog | 489 | 2055 | 0.822 | 0.630 |
| horse | 348 | 1900 | 0.865 | 0.630 |
| motorbike | 325 | 1340 | 0.766 | 0.626 |
| person | 4528 | 19870 | 0.810 | 0.640 |
| pottedplant | 480 | 2273 | 0.442 | 0.234 |
| sheep | 242 | 1115 | 0.645 | 0.444 |
| sofa | 239 | 1687 | 0.824 | 0.555 |
| train | 282 | 1130 | 0.819 | 0.711 |
| tvmonitor | 308 | 1912 | 0.776 | 0.593 |
+-------------+------+-------+--------+-------+
| mAP | | | | 0.542 |
+-------------+------+-------+--------+-------+
2022-04-20 15:41:02,866 - mmdet - INFO - Epoch [5][2000/2000] lr: 1.000e-04, mAP: 0.5415mAP: 0.5415
…------------------ 原始邮件 ------------------
发件人: "Tianning ***@***.***>;
发送时间: 2022年4月20日(星期三) 下午3:39
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [yuantn/MI-AOD] Validaiton| TypeError: 'DataContainer' object is not subscriptable (#14)
我在终端输入python tools/train.py configs/MIAOD.py 运行没有问题,但是输入./script.sh 0时就有问题了
请提供你的输出日志。
Please provide your output log.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
请提供你对应的 Please your corresponding |
Encounter this error when procssessing validation
The text was updated successfully, but these errors were encountered: