Exemplo n.º 1
0
def execute_validation(gpus,
                       exp_folder,
                       exp_alias,
                       validation_datasets,
                       erase_bad_validations,
                       restart_validations,
                       suppress_output=True):
    """
    Args:
        gpus: The gpu being used for this execution.
        exp_folder: The folder this driving experiment is being executed
        exp_alias: The experiment alias, file name, to be executed.
        validation_datasets: Validation datasets to be deleted/restarted
        erase_bad_validations:
        restart_validations:
        suppress_output:
    Returns:
    """
    validation_datasets = validation_datasets.split(
        ',')  # Turn a string into a list of the names
    create_log_folder(exp_folder)
    create_exp_path(exp_folder, exp_alias)
    if erase_bad_validations:
        erase_wrong_plotting_summaries(exp_folder, validation_datasets)
    if restart_validations:
        erase_validations(exp_folder, validation_datasets)
    # The difference between train and validation is the
    p = multiprocessing.Process(target=validate.execute,
                                args=(gpus, exp_folder, exp_alias,
                                      validation_datasets[0], suppress_output))
    p.start()
Exemplo n.º 2
0
    # Check if the driving parameters are passed in a correct way
    if args.driving_environments is not None:
        for de in list(args.driving_environments):
            if len(de.split('_')) < 2:
                raise ValueError(
                    "Invalid format for the driving environments should be Suite_Town"
                )

    # This is the folder creation of the
    create_log_folder(args.folder)
    erase_logs(args.folder)
    if args.erase_bad_validations:
        erase_wrong_plotting_summaries(args.folder,
                                       list(args.validation_datasets))
    if args.restart_validations:
        erase_validations(args.folder, list(args.validation_datasets))

    # The definition of parameters for driving
    drive_params = {
        "suppress_output": True,
        "no_screen": args.no_screen,
        "docker": args.docker,
        "record_collisions": args.record_collisions
    }
    # There are two modes of execution
    if args.single_process is not None:
        ####
        # MODE 1: Single Process. Just execute a single experiment alias.
        ####

        if args.exp is None: