2

I'm having issues with tensorflow os warnings. I know there are quite a few solutions already there on stack overflow and have already tried all those. Like for e.g. this: Disable Tensorflow debugging information

import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import logging
logging.getLogger('tensorflow').setLevel(logging.ERROR)

import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
tf.config.set_soft_device_placement(True)
tf.debugging.set_log_device_placement(True)
list_gpu = tf.config.experimental.list_physical_devices(device_type='GPU')
for gpu in list_gpu: tf.config.experimental.set_memory_growth(gpu, True)
print('Num GPUs Available: ', len(list_gpu))

Getting this printed:

Executing op RandomUniform in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op Sub in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op Mul in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op Add in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarHandleOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op VarIsInitializedOp in device /job:localhost/replica:0/task:0/device:GPU:0
Executing op LogicalNot in device /job:localhost/replica:0/task:0/device:GPU:0

Am I missing something here?

  • Tensorflow version = 2.2.1
  • Using Google Colab

Please help! TIA.

PratikSharma
  • 321
  • 2
  • 17

1 Answers1

0

Have you tried

tf.logging.set_verbosity(tf.logging.ERROR)

or

tf.get_logger().setLevel(3)
DanBrezeanu
  • 523
  • 3
  • 13