anyone knows if there is a method to prevent tensorflow from polluting standard error with gpus\' memory allocation log?. I noted that when the following command is executed
You can set an environment variable before launching Python as described in the first answer, or you can add the following lines to your Python code:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
Change 3 to values (0, 1, 2, 3) according to the messages you want avaoid.
PS: If you're using TensorFlow => 2.0, make sure to put those lines before importing tensorflow to be effective.