essentia
essentia copied to clipboard
How to disable Warning and tensorflow logger?
Thanks for your great work. It is very useful.
I want to use essential to tag music files. Hence, I want to feed a list of music one after another to the model. However, I keep getting the warning "No network created, or last created network has been deleted..." and the log of Tensorflow. I can not get the prediction of the model while the output is filled by the warning messages and log of Tensorflow. Besides, the warning message may slow down my process.
The codes are written in python.
Are there any solutions to disable the warning messages and TensorFlow logger?
You can set it using an environment variable at the top of your script like this:
# quiet tensorflow warnings
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
Defaults to 0, so all logs are shown. Set TF_CPP_MIN_LOG_LEVEL to 1 to filter out INFO logs, 2 to additionall filter out WARNING, 3 to additionally filter out ERROR.
You can set it using an environment variable at the top of your script like this:
# quiet tensorflow warnings import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
Defaults to 0, so all logs are shown. Set TF_CPP_MIN_LOG_LEVEL to 1 to filter out INFO logs, 2 to additionall filter out WARNING, 3 to additionally filter out ERROR.
Thanks for your reply. I have tried this method before but It didn't work. Besides, the warning about "No network created, or last created network has been deleted..." is the major output when I run my program.
You can deactivate Essentia logging as in #1213
The proposed solution for the TensorFlow logging does work for me. It is important that the TF_CPP_MIN_LOG_LEVEL
variable is set before importing TensorFlow. Did you do it this way?
Closing due to inactivity. Feel free to re-open if there is any question about the provided solutions.