Bug when running the testing script
cdb342 opened this issue · comments
File "FB-BEV/mmdet3d/models/fbbev/detectors/fbocc.py", line 486, in forward_test
if num_augs==1 and not img_metas[0][0].get('tta_config', dict(dist_tta=False))['dist_tta']:
TypeError: 'DataContainer' object is not subscriptable
I also encountered this error, have you solved this problem?
I think this is the problem of versions of openmmlab packages. The input img_metas
still are wrapped with its DataContainer
, and this can be solved by calling .data
property of DataContainer
to recover the raw data.
mmcls 0.25.0
mmcv-full 1.5.2
mmdet 2.24.0
mmdet3d 1.0.0rc4
mmsegmentation 0.24.0
this is my envs,actually it's created according to your install.md,I have tried the following operation:
type(img_metas[0])
<class 'mmcv.parallel.data_container.DataContainer'>
img_metas[0].data()
Traceback (most recent call last):
File "", line 1, in
TypeError: 'list' object is not callable
As you can see,.data()
seems not to be useful for the question @zhiqi-li
mmcls 0.25.0 mmcv-full 1.5.2 mmdet 2.24.0 mmdet3d 1.0.0rc4 mmsegmentation 0.24.0 this is my envs,actually it's created according to your install.md,I have tried the following operation: type(img_metas[0]) <class 'mmcv.parallel.data_container.DataContainer'> img_metas[0].data() Traceback (most recent call last): File "", line 1, in TypeError: 'list' object is not callable
As you can see,
.data()
seems not to be useful for the question @zhiqi-li
I change the code as this and it works:
# if num_augs==1 and not img_metas[0][0].get('tta_config', dict(dist_tta=False))['dist_tta']:
if num_augs==1 and not img_metas[0].data[0][0].get('tta_config', dict(dist_tta=False))['dist_tta']:
# return self.simple_test(points[0], img_metas[0], img_inputs[0],
# **kwargs)
return self.simple_test(points[0], img_metas[0].data[0], img_inputs[0],
**kwargs)
else:
@cdb342 Maybe you should consider submitting a pull request that addresses this problem.