Skip to content
Advertisement

Tensorflow Warning every time I import it – ‘cudart64_101.dll not found’. Is there a way to get rid of only this warning?

2021-01-26 17:13:35.314383: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2021-01-26 17:13:35.321533: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

The execution of the code tends to pause for a while when this occurs. Is there a solution to this?

Advertisement

Answer

If you’re working with Tensorflow 2.0, setting TF_CPP_MIN_LOG_LEVEL should still work

You can disable all logs using os.environ:

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' 
import tensorflow as tf

Here,

0 = all messages are logged (default behavior)
1 = INFO messages are not printed
2 = INFO and WARNING messages are not printed
3 = INFO, WARNING, and ERROR messages are not printed

(The above is tested on TensorFlow 0.12 and 1.0)

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement