Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
leiyue opened this issue Apr 13, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@leiyue
Copy link

leiyue commented Apr 13, 2023

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
@oguiza oguiza added the bug Something isn't working label Apr 13, 2023
@oguiza
Copy link
Contributor

oguiza commented Apr 13, 2023

Hi @leiyue,
You are right. I verbose is set to False, nothing should be printed. That was a miss.
Would you like to create a PR to fix this issue?

@oguiza
Copy link
Contributor

oguiza commented Jul 2, 2023

This issue is fixed now.

@oguiza oguiza closed this as completed Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants