Skip to content

AttributeError: 'list' object has no attribute 'keys' #7

@RhythmOfTheRain-Byte

Description

@RhythmOfTheRain-Byte

Excuse me, following the operations in the "Getting Started" section:

  1. Generate the Inflated Occupancy Annotations as described [here].
    Run the training and evaluation scripts using the provided configurations.
    Since the model's forward process is not executed, this will not consume GPU memory:
    I executed the following command:

./tools/dist_test.sh projects/configs/inflated/action_condition_GMO.py work_dirs/action_condition_GMO/epoch_1.pth 1

During the generation of evaluation data, I encountered the following error:

'list' object has no attribute 'keys'
File "Drive-OccWorld/projects/mmdet3d_plugin/datasets/nuscenes_world_dataset_template.py", line 554, in evaluate
if 'hist_for_iou' in results.keys():
File "Drive-OccWorld/tools/test.py", line 262, in main
print(dataset.evaluate(outputs, **eval_kwargs))
File "Drive-OccWorld/tools/test.py", line 266, in
main()
AttributeError: 'list' object has no attribute 'keys'

The problem comes from the following code snippet in nuscenes_world_dataset_template.py:

def evaluate(self, results, logger=None, **kwargs):
'''
Evaluate by IOU and VPQ metrics for model evaluation
'''
eval_results = {}
''' calculate IOU of current and future frames'''
if 'hist_for_iou' in results.keys():

It seems that results is a list instead of a dictionary, which causes an error when calling results.keys(). This issue occurs during the testing phase.
How should I solve this problem?

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