metadriverse / trafficgen

[ICRA 2023] The official code for paper "TrafficGen: Learning to Generate Diverse and Realistic Traffic Scenarios"
Apache License 2.0
153 stars 24 forks source link

AttributeError: 'Tensor' object has no attribute 'items' #41

Closed axelbr closed 6 months ago

axelbr commented 10 months ago

There are some type bugs when running python train_act.py -c local.

I get an attribute error in the tg_act.py file. For instance in this line (and several other occasions): https://github.com/metadriverse/trafficgen/blob/33b57467c3d0bb31b8393998057c67df2aebc550/trafficgen/act/model/tg_act.py#L105

It looks like that the loss tensor used instead of loss_dict.

PabloVD commented 7 months ago

It also happened to me. It seems that replacing loss.items() by loss_dict.items() fixed the bug.