nuplan-devkit icon indicating copy to clipboard operation
nuplan-devkit copied to clipboard

Can't load scenario using cached data?

Open Jeff09 opened this issue 2 years ago • 4 comments

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.

Jeff09 avatar Sep 02 '22 19:09 Jeff09

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?

mspryn-motional avatar Sep 06 '22 19:09 mspryn-motional

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 avatar Sep 06 '22 21:09 Jeff09

@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. https://github.com/motional/nuplan-devkit/blob/3a4dba5fc6bab7319fb2855eb9d9867eb17336b3/nuplan/planning/script/builders/scenario_builder.py#L113 That's why i'm confused here. Do I need to implement a new cached nuplanscenario class inherited from CachedScenario ?

Jeff09 avatar Sep 13 '22 22:09 Jeff09

The bug is similar as #128

Jeff09 avatar Sep 15 '22 18:09 Jeff09

Hi @Jeff09,

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

patk-motional avatar Nov 02 '22 08:11 patk-motional

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. https://github.com/motional/nuplan-devkit/blob/d12f45b63c72d06aac503b12ee18d61a4fdc5c32/nuplan/planning/script/builders/scenario_builder.py#L77

Jeff09 avatar Nov 02 '22 17:11 Jeff09