Thanks to visit codestin.com
Credit goes to github.com

Skip to content

get_best_dls_params function still prints output when the verbose parameter is set to false #737

@leiyue

Description

@leiyue

get_best_dls_params function still prints output when the verbose parameter is set to false. I made a little tweak, hope that helps.

def get_best_dls_params(dls, n_iters=10, num_workers=[0, 1, 2, 4, 8], pin_memory=[True, False], prefetch_factor=[2, 4, 8], return_best=True, verbose=True):

    for i in range(len(dls.loaders)):
        try:
            if verbose:
                print(f'\nDataloader {i}\n')
            dls.loaders[i] = get_best_dl_params(dls.loaders[i], n_iters=n_iters, num_workers=num_workers, pin_memory=pin_memory, prefetch_factor=prefetch_factor, return_best=return_best, verbose=verbose)
        except KeyboardInterrupt: pass
    return dls

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions