NVlabs / trajdata

A unified interface to many trajectory forecasting datasets.
Apache License 2.0
290 stars 38 forks source link

Not possible to call method `get_obs` after `finalize` of `SimulationScene` #8

Closed Leon0402 closed 1 year ago

Leon0402 commented 2 years ago
sim_scene.finalize()
sim_scene.get_obs()

throws "No such file or directory: ..." if map support is enabled.

The reason is that the scene_name is changed in finalize: https://github.com/nvr-avg/trajdata/blob/55dd41525023b307393edf30979aed6babc93a13/src/trajdata/simulation/sim_scene.py#L184

and then the path to the map is not correct: https://github.com/nvr-avg/trajdata/blob/24251636bc708bd20e91a538b68095300a3199c8/src/trajdata/caching/df_cache.py#L509

Using sim_scene.save() doesn't fix it either as it only saves agent & scene info, but not the map itself.

Edit: It is possible to use sim_scene.get_obs(get_map=False) though. So the behavior described might be intentional. In that case the question might be if this user error could be detected by saving that no map is available anymore.