Tensorflow warning and information prints

Hello, I am using tf in my backend application and once i run the .py file with tf import without even use it . It took time to print warnings snd information of tf libraries trace and then it continue the .py code process. What should i have to do to stop tf from make this trace it’s really increase my code response time. One of the warrning it says that i don’t have tf gpu libraries even that i am not using tf functions just what i did is to import it.

You can set your log level before importing TF with:

os.environ['TF_CPP_MIN_LOG_LEVEL']

3 Likes

It doesn’t work. I don’t need to just ignore the prints i want to stop this trace functions since It slow down the run time for the model

What is your backend context? Flask?

The warnngs printed at import time should only happen once per python interpreter instance. They cannot slow down any runtime as they are constant set up time.

I think what you are seeing is different. Can you give us more details please? What version of TF? What operating system? How did you install it? A minimal code that reproduces the issue?