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

How do I turn off logging? #1376

Closed
catskillsresearch opened this issue Oct 30, 2020 · 5 comments
Closed

How do I turn off logging? #1376

catskillsresearch opened this issue Oct 30, 2020 · 5 comments

Comments

@catskillsresearch
Copy link

How do I turn off all the logging messages in NeMo? For example all of this:

[NeMo W 2020-10-30 00:16:51 experimental:28] Module <class 'nemo.collections.asr.data.audio_to_text.AudioToCharDataset'> is experimental, not ready for production and is not fully supported. Use at your own risk.
[NeMo W 2020-10-30 00:16:51 experimental:28] Module <class 'nemo.collections.asr.data.audio_to_text.AudioToBPEDataset'> is experimental, not ready for production and is not fully supported. Use at your own risk.
[NeMo W 2020-10-30 00:16:51 experimental:28] Module <class 'nemo.collections.asr.data.audio_to_text.AudioLabelDataset'> is experimental, not ready for production and is not fully supported. Use at your own risk.
[NeMo W 2020-10-30 00:16:51 experimental:28] Module <class 'nemo.collections.asr.data.audio_to_text._TarredAudioToTextDataset'> is experimental, not ready for production and is not fully supported. Use at your own risk.
[NeMo W 2020-10-30 00:16:51 experimental:28] Module <class 'nemo.collections.asr.data.audio_to_text.TarredAudioToCharDataset'> is experimental, not ready for production and is not fully supported. Use at your own risk.
[NeMo W 2020-10-30 00:16:51 experimental:28] Module <class 'nemo.collections.asr.data.audio_to_text.TarredAudioToBPEDataset'> is experimental, not ready for production and is not fully supported. Use at your own risk.
wandb: WARNING W&B installed but not logged in.  Run `wandb login` or set the WANDB_API_KEY env variable.
[NeMo W 2020-10-30 00:16:52 experimental:28] Module <class 'nemo.collections.asr.losses.ctc.CTCLoss'> is experimental, not ready for production and is not fully supported. Use at your own risk.
################################################################################
### WARNING, path does not exist: KALDI_ROOT=/mnt/matylda5/iveselyk/Tools/kaldi-trunk
###          (please add 'export KALDI_ROOT=<your_path>' in your $HOME/.profile)
###          (or run as: KALDI_ROOT=<your_path> python <your_script>.py)
################################################################################
@soheiltehranipour
Copy link

This is my question too.

@rohitgr7
Copy link

rohitgr7 commented Nov 2, 2020

Try this after importing nemo modules:

import logging
logging.getLogger('nemo_logger').setLevel(logging.ERROR)

you can choose the logging level from https://docs.python.org/3/library/logging.html#levels

@catskillsresearch
Copy link
Author

catskillsresearch commented Feb 15, 2022

This does the trick, prior to importing anything from NeMo:

import logging
logging.disable(logging.CRITICAL)
import nemo.collections.asr

This won't get rid of some noise about Kaldi:

################################################################################
### WARNING, path does not exist: KALDI_ROOT=/tmp/kaldi
###          (please add 'export KALDI_ROOT=<your_path>' in your $HOME/.profile)
###          (or run as: KALDI_ROOT=<your_path> python <your_script>.py)
################################################################################

To get rid of the Kaldi warning, download Kaldi and set KALDI_ROOT. So something like this prior to running the above script (you can put kaldi anywere, it doesn't have to be /tmp):

cd /tmp
git clone https://github.com/kaldi-asr/kaldi.git
export KALDI_ROOT=/tmp/kaldi

@catskillsresearch
Copy link
Author

@burgil the initial question was posed by me for my needs. Turning off all logging output satisfies my original question. How do you see that as "poor" when I am the person asking and this method does exactly what I wanted it to? Poor for who?

Another way of phrasing your comment would be to say "I see how this works for you, but for my needs that would cut out too much information, so for my application I would prefer to omit critical".

@guilhermehge
Copy link

If you want to disable only NeMo loggings and not all of them, just use this:

logging.basicConfig(level = logging.INFO)
logging.getLogger("nemo_logger").setLevel(logging.ERROR)

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

No branches or pull requests

5 participants