Skip to content

Is there a way to supress all printing and warnings in the Trainer? #4462

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

Closed
erap129 opened this issue Nov 1, 2020 · 5 comments
Closed

Is there a way to supress all printing and warnings in the Trainer? #4462

erap129 opened this issue Nov 1, 2020 · 5 comments
Labels
question Further information is requested

Comments

@erap129
Copy link

erap129 commented Nov 1, 2020

Hello,
I am aware of the progress_bar_refresh_rate and weight_summary parameters, but even when I disable them I get these GPU warning-like messages:
image
I would like to disable all warnings and printings from the Trainer, is this possible?
Why? because I want to perform several training operations in a loop and monitor them with tqdm, so intermediate printing will ruin the tqdm progress bar.

@erap129 erap129 added the question Further information is requested label Nov 1, 2020
@ydcjeff
Copy link
Contributor

ydcjeff commented Nov 1, 2020

@erap129 See: https://pytorch-lightning.readthedocs.io/en/0.9.0/experiment_reporting.html#configure-console-logging

@ydcjeff ydcjeff closed this as completed Nov 2, 2020
@amin-nejad
Copy link
Contributor

@daniilino
Copy link

Both snippets from above links are not working :(

@jarun-title
Copy link

jarun-title commented Jan 21, 2024

see this comment. These two lines work for me

@turbotimon
Copy link

turbotimon commented Mar 20, 2025

To make it short for everyone looking for the answer:

For the old lightning:

import pytorch_lightning
import logging
logging.getLogger("pytorch_lightning").setLevel(logging.ERROR)

For the new lightning:

import lightning
import logging
logging.getLogger("lightning.pytorch").setLevel(logging.ERROR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants