motional / nuplan-devkit

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

Data is lack in docker container #190

Closed CrisCloseTheDoor closed 1 year ago

CrisCloseTheDoor commented 1 year ago

Hi developers:

When I'm running submission and simulation docker containers, error occurs:

submission

submission_1  | Global seed set to 0
submission_1  | Error executing job with overrides: ['output_dir=/tmp/', 'planner=simple_planner']
submission_1  | Traceback (most recent call last):
submission_1  |   File "/nuplan_devkit/nuplan/database/common/blob_store/local_store.py", line 40, in get
submission_1  |     with open(path, 'rb') as fp:
submission_1  | FileNotFoundError: [Errno 2] No such file or directory: '/data/sets/nuplan/maps/nuplan-maps-v1.0.json'
submission_1  | 
submission_1  | During handling of the above exception, another exception occurred:
submission_1  | 
submission_1  | Traceback (most recent call last):
submission_1  |   File "/nuplan_devkit/nuplan/planning/script/run_submission_planner.py", line 50, in main
submission_1  |     submission_planner = SubmissionPlanner(planner=planner)
submission_1  |   File "/nuplan_devkit/nuplan/submission/submission_planner.py", line 31, in __init__
submission_1  |     GPKGMapsDB(
submission_1  |   File "/nuplan_devkit/nuplan/database/maps_db/gpkg_mapsdb.py", line 75, in __init__
submission_1  |     version_file = self._blob_store.get(f"{self._map_version}.json")  # get blob and save to disk
submission_1  |   File "/nuplan_devkit/nuplan/database/common/blob_store/local_store.py", line 43, in get
submission_1  |     raise BlobStoreKeyNotFound(e)
submission_1  | nuplan.database.common.blob_store.blob_store.BlobStoreKeyNotFound: [Errno 2] No such file or directory: '/data/sets/nuplan/maps/nuplan-maps-v1.0.json'
submission_1  | 
submission_1  | Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
submission_1  | nuplan10_submission_1 exited with code 1

simulation

simulation_1  | Global seed set to 0
simulation_1  | INFO:nuplan.planning.script.builders.main_callback_builder:Building MultiMainCallback...
simulation_1  | INFO:matplotlib.font_manager:generated new fontManager
simulation_1  | INFO:nuplan.planning.script.builders.main_callback_builder:Building MultiMainCallback: 4...DONE!
simulation_1  | 2022-11-23 07:34:35,018 INFO {/nuplan_devkit/nuplan/planning/script/builders/worker_pool_builder.py:19}  Building WorkerPool...
simulation_1  | 2022-11-23 07:34:35,019 INFO {/nuplan_devkit/nuplan/planning/utils/multithreading/worker_pool.py:101}  Worker: Sequential
simulation_1  | 2022-11-23 07:34:35,019 INFO {/nuplan_devkit/nuplan/planning/utils/multithreading/worker_pool.py:102}  Number of nodes: 1
simulation_1  | Number of CPUs per node: 1
simulation_1  | Number of GPUs per node: 0
simulation_1  | Number of threads across all nodes: 1
simulation_1  | 2022-11-23 07:34:35,019 INFO {/nuplan_devkit/nuplan/planning/script/builders/worker_pool_builder.py:27}  Building WorkerPool...DONE!
simulation_1  | 2022-11-23 07:34:35,019 INFO {/nuplan_devkit/nuplan/planning/script/builders/folder_builder.py:29}  Building experiment folders...
simulation_1  | 2022-11-23 07:34:35,019 INFO {/nuplan_devkit/nuplan/planning/script/builders/folder_builder.py:32}  
simulation_1  | 
simulation_1  |     Folder where all results are stored: /*****/nuplan/nuplan1.0/nuplan/exp/exp/simulation_open_loop_boxes/2022.11.23.07.34.32
simulation_1  | 
simulation_1  | 2022-11-23 07:34:35,020 INFO {/nuplan_devkit/nuplan/planning/script/builders/folder_builder.py:63}  Building experiment folders...DONE!
simulation_1  | 2022-11-23 07:34:35,020 INFO {/nuplan_devkit/nuplan/planning/script/builders/scenario_building_builder.py:18}  Building AbstractScenarioBuilder...
simulation_1  | Error executing job with overrides: ['+simulation=open_loop_boxes', 'planner=[remote_planner]', 'worker=sequential', 'scenario_builder=nuplan_challenge', 'scenario_filter=nuplan_challenge_scenarios', 'scenario_builder.db_files=/data/sets/nuplan/nuplan-v1.1/mini/2021.07.16.20.45.29_veh-35_01095_01486.db', 'scenario_filter.limit_total_scenarios=1', 'contestant_id=test', 'submission_id=contestant']
simulation_1  | Traceback (most recent call last):
simulation_1  |   File "/opt/conda/envs/nuplan/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 62, in _call_target
simulation_1  |     return target(*args, **kwargs)
simulation_1  |   File "/nuplan_devkit/nuplan/planning/scenario_builder/nuplan_db/nuplan_scenario_builder.py", line 65, in __init__
simulation_1  |     self._db_files = discover_log_dbs(data_root if db_files is None else db_files)
simulation_1  |   File "/nuplan_devkit/nuplan/planning/scenario_builder/nuplan_db/nuplan_scenario_filter_utils.py", line 150, in discover_log_dbs
simulation_1  |     db_filenames = get_db_filenames_from_load_path(load_path)
simulation_1  |   File "/nuplan_devkit/nuplan/planning/scenario_builder/nuplan_db/nuplan_scenario_filter_utils.py", line 121, in get_db_filenames_from_load_path
simulation_1  |     assert Path(load_path).is_file(), f'Local db path does not exist: {load_path}'
simulation_1  | AssertionError: Local db path does not exist: /data/sets/nuplan/nuplan-v1.1/mini/2021.07.16.20.45.29_veh-35_01095_01486.db
simulation_1  | 
simulation_1  | During handling of the above exception, another exception occurred:
simulation_1  | 
simulation_1  | Traceback (most recent call last):
simulation_1  |   File "/nuplan_devkit/nuplan/planning/script/run_simulation.py", line 100, in main
simulation_1  |     run_simulation(cfg=cfg)
simulation_1  |   File "/nuplan_devkit/nuplan/planning/script/run_simulation.py", line 54, in run_simulation
simulation_1  |     scenario_builder = build_scenario_builder(cfg=cfg)
simulation_1  |   File "/nuplan_devkit/nuplan/planning/script/builders/scenario_building_builder.py", line 19, in build_scenario_builder
simulation_1  |     scenario_builder = instantiate(cfg.scenario_builder)
simulation_1  |   File "/opt/conda/envs/nuplan/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 180, in instantiate
simulation_1  |     return instantiate_node(config, *args, recursive=_recursive_, convert=_convert_)
simulation_1  |   File "/opt/conda/envs/nuplan/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 249, in instantiate_node
simulation_1  |     return _call_target(target, *args, **kwargs)
simulation_1  |   File "/opt/conda/envs/nuplan/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 64, in _call_target
simulation_1  |     raise type(e)(
simulation_1  |   File "/opt/conda/envs/nuplan/lib/python3.9/site-packages/hydra/_internal/instantiate/_instantiate2.py", line 62, in _call_target
simulation_1  |     return target(*args, **kwargs)
simulation_1  |   File "/nuplan_devkit/nuplan/planning/scenario_builder/nuplan_db/nuplan_scenario_builder.py", line 65, in __init__
simulation_1  |     self._db_files = discover_log_dbs(data_root if db_files is None else db_files)
simulation_1  |   File "/nuplan_devkit/nuplan/planning/scenario_builder/nuplan_db/nuplan_scenario_filter_utils.py", line 150, in discover_log_dbs
simulation_1  |     db_filenames = get_db_filenames_from_load_path(load_path)
simulation_1  |   File "/nuplan_devkit/nuplan/planning/scenario_builder/nuplan_db/nuplan_scenario_filter_utils.py", line 121, in get_db_filenames_from_load_path
simulation_1  |     assert Path(load_path).is_file(), f'Local db path does not exist: {load_path}'
simulation_1  | AssertionError: Error instantiating 'nuplan.planning.scenario_builder.nuplan_db.nuplan_scenario_builder.NuPlanScenarioBuilder' : Local db path does not exist: /data/sets/nuplan/nuplan-v1.1/mini/2021.07.16.20.45.29_veh-35_01095_01486.db
simulation_1  | 
simulation_1  | Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
simulation_1  | ERROR conda.cli.main_run:execute(41): `conda run python -u nuplan/planning/script/run_simulation.py +simulation=open_loop_boxes planner=[remote_planner] worker=sequential scenario_builder=nuplan_challenge scenario_filter=nuplan_challenge_scenarios scenario_builder.db_files=/data/sets/nuplan/nuplan-v1.1/mini/2021.07.16.20.45.29_veh-35_01095_01486.db scenario_filter.limit_total_scenarios=1 contestant_id=test submission_id=contestant` failed. (See above for error)
nuplan10_simulation_1 exited with code 1

It seems that data is lack in containers.

my command:

docker build --network host -f Dockerfile.submission . -t nuplan-evalservice-server:test.contestant
docker-compose up --build
CrisCloseTheDoor commented 1 year ago

@gianmarco-motional

gianmarco-motional commented 1 year ago

The directory /data inside the container is mounted according to docker-compose.yml file (see here).

As mentioned in the docs, by default looking at $NUPLAN_DATA_ROOT, $NUPLAN_MAPS_ROOT and $NUPLAN_EXP_ROOT. Make sure your data is at the same place of where docker compose tries to mount from.

gianmarco-motional commented 1 year ago

@CrisCloseTheDoor Did this solve your problem?

CrisCloseTheDoor commented 1 year ago

@CrisCloseTheDoor Did this solve your problem?

Thanks for your reply, I've checked it but problem still exists.

I put data and maps into my directory ~/nuplan_devkit/data/sets/nuplan Then I modified dockerfile and docker-compose.yml to change$NUPLAN_DATA_ROOT=$NUPLAN_HOME/data/sets/nuplan, while NUPLAN_MAPS_ROOT and NUPLAN_EXP_ROOT did the same. But the same error exsits, i.e, maps/nuplan-maps-v1.0.json and db file couldn't be found

Where should I put data in ?

gianmarco-motional commented 1 year ago

The data can be anywhere you want on your filesystem, as long as you volume mount correctly. This is not really a devkit problem but more of Docker/filesystem problem. It's very hard to help as I don't have access to your system. Maybe first test with an absolute volume mount such as /tmp/data:/tmp:data and check how that works, and slowly build up to bring env variables to check what is going on.