File size: 1,090 Bytes
da2e2ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import logging
import hydra
from omegaconf import DictConfig

from nuplan.planning.script.builders.logging_builder import build_logger

from navsim.planning.metric_caching.caching import cache_data
from navsim.planning.script.builders.worker_pool_builder import build_worker


logger = logging.getLogger(__name__)

CONFIG_PATH = "config/metric_caching"
# CONFIG_NAME = "cache_trainval_pt1"


# @hydra.main(config_path=CONFIG_PATH, config_name=CONFIG_NAME)
@hydra.main(config_path=CONFIG_PATH,)
def main(cfg: DictConfig) -> None:
    """

    Main entrypoint for training/validation experiments.

    :param cfg: omegaconf dictionary

    """
    # Configure logger
    build_logger(cfg)
    # Build worker
    worker = build_worker(cfg)

    # Precompute and cache all features
    logger.info("Starting Metric Caching...")
    if cfg.worker == "ray_distributed" and cfg.worker.use_distributed:
        raise AssertionError("ray in distributed mode will not work with this job")
    cache_data(cfg=cfg, worker=worker)

if __name__ == "__main__":
    main()