motional / nuplan-devkit

The devkit of the nuPlan dataset.
https://www.nuplan.org
Other
673 stars 129 forks source link

Questions about how to set cfg settings to run baselines(LaneGCN and MLP) #257

Closed nortonlrc closed 1 year ago

nortonlrc commented 1 year ago

In the tutorial we have run raster model. Now we want to run the baselines based on vectors (MLP and LaneGCN), but when we changed the cfg settings in nuplan_framework.ipynb, it reported errors during the feature building process. We think the reason is that we did not write right cfg. So could the motional team tell us the correct cfg settings? Our current setting is attached as following:

cfg = hydra.compose(config_name=CONFIG_NAME, overrides=[ f'group={str(SAVE_DIR)}', f'cache.cache_path={str(SAVE_DIR)}/cache', f'experiment_name={EXPERIMENT}', f'job_name={JOB_NAME}', 'py_func=train', '+training=training_raster_model', # raster model that consumes ego, agents and map raster layers and regresses the ego's trajectory 'scenario_builder=nuplan_mini', # use nuplan mini database 'scenario_filter.limit_total_scenarios=500', # Choose 500 scenarios to train with 'lightning.trainer.params.accelerator=ddp_spawn', # ddp is not allowed in interactive environment, using ddp_spawn instead - this can bottleneck the data pipeline, it is recommended to run training outside the notebook 'lightning.trainer.params.max_epochs=10', 'data_loader.params.batch_size=8', 'data_loader.params.num_workers=8', ])

cfg['model']={ '_target_': 'nuplan.planning.training.modeling.models.simple_vector_map_model.VectorMapSimpleMLP', '_convert_': 'all', 'num_output_features':3, 'hidden_size':128, 'vector_map_feature_radius':20, 'past_trajectory_sampling': { '_target_': 'nuplan.planning.simulation.trajectory.trajectory_sampling.TrajectorySampling', '_convert_': 'all', 'num_poses': 16, 'time_horizon': 8.0 }, 'future_trajectory_sampling': { '_target_': 'nuplan.planning.simulation.trajectory.trajectory_sampling.TrajectorySampling', '_convert_': 'all', 'num_poses': 16, 'time_horizon': 8.0 } } cfg['scenario_builder']['data_root']='${oc.env:NUPLAN_DATA_ROOT}/nuplan-v1.1_mini/mini'

patk-motional commented 1 year ago

Hi @nortonlrc,

Can you share what error you got?

From quick inspection, I can see that you are specifying to train the raster model in the first config +training=training_raster_model. It should be set to the model you want to train with. In this case training_vector_model.yaml or training_simple_vector_model.yaml.

In saying that, we do not recommend running the different planner in the tutorial but rather directly running run_training.py and run_simulation.py from terminal.

nortonlrc commented 1 year ago

Hi @patk-motional, Thank you very much, we tried the method you provided and solved our problem successfully.