Skip to content
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

Can't load scenario using cached data? #117

Closed
Jeff09 opened this issue Sep 2, 2022 · 6 comments
Closed

Can't load scenario using cached data? #117

Jeff09 opened this issue Sep 2, 2022 · 6 comments
Assignees

Comments

@Jeff09
Copy link

Jeff09 commented Sep 2, 2022

Hi,

Thank you for such wonderful repo. I just found there might be issues when I use create_scenario_from_paths.py to load cached data.

First, at https://github.com/motional/nuplan-devkit/blob/update-devkit-v0.4/nuplan/planning/script/builders/scenario_builder.py#L179, the log_name seems to path.parent.name not path.parent.parent.name.

Second, when using CachedScenario class, it'll also have some NotImplementedError coming out. It looks like it should use NuplanScenario class.

Thank you for your replies.

@mspryn-motional
Copy link

Hello.

For (1): When was the cache created? There was recently a change to add scenario_type to the cache path, so it may need to be regenerated.

For (2): This is by design. CachedScenario is merely a wrapper that contains enough information to load the scenario from a precomputed cache. It is not intended to be used for actually computing features. Can you provide a little more information about which methods you are hitting the NotImplementedErrors with?

@Jeff09
Copy link
Author

Jeff09 commented Sep 6, 2022

Hello,

Thank you for replying.

For 1), I used the Nuplan-devkit 0.3 version of cache function, not use the latest version to generate the cache. And that might be the problem.

For 2), when I loaded the precomputed cache, at https://github.com/motional/nuplan-devkit/blob/update-devkit-v0.4/nuplan/planning/script/builders/scenario_builder.py#L178, the scenarios use CachedScenario wrapper class, not using NuplanScenario class to do the actually computing features. Here's the screenshot to show the error.
image

@Jeff09
Copy link
Author

Jeff09 commented Sep 13, 2022

@mspryn-motional @patk-motional
Hi, I have regenerated the cache data using Nuplan-devkit 0.5 version, but it still can't training the model using cached data.
There're 511215 scenarios extracted for training in the nuplan-mini dataset. Here's the screenshot to show the error.
image

In the Nuplan-devkit 0.3 version, the cached data is loaded by the NuplanScenario class at the following line.

scenario_cls(log_name=path.parent.name, initial_lidar_token=path.name, **scenario_args) for path in paths

That's why i'm confused here. Do I need to implement a new cached nuplanscenario class inherited from CachedScenario ?

@Jeff09
Copy link
Author

Jeff09 commented Sep 15, 2022

The bug is similar as #128

@patk-motional
Copy link
Collaborator

Hi @Jeff09,

Sorry for the late reply. Has this issue been resolved for you since the v1.0 release?

@Jeff09
Copy link
Author

Jeff09 commented Nov 2, 2022

Hi @patk-motional,

Thank you for asking. The problem is still exist in the v1.0 release. The line will raise error when loading cache data.

candidate_scenario_dirs = [path for log_dir in cache_dir.iterdir() for path in log_dir.iterdir()]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants