How to suppress verbose Tensorflow logging? [duplicate]

2.0 Update (10/8/19) Setting TF_CPP_MIN_LOG_LEVEL should still work (see below in v0.12+ update), but there is currently an issue open (see issue #31870). If setting TF_CPP_MIN_LOG_LEVEL does not work for you (again, see below), try doing the following to set the log level: import tensorflow as tf tf.get_logger().setLevel(‘INFO’) In addition, please see the documentation on … Read more

ImportError: libcublas.so.10.0: cannot open shared object file: No such file or directory

I downloaded cuda 10.0 from the following link CUDA 10.0 Then I installed it using the following commands: sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb sudo apt-key adv –fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub sudo apt-get update sudo apt-get install cuda-10-0 I then installed cudnn v7.5.0 for CUDA 10.0 by going to link CUDNN download and you need to logon using an … Read more

What does batch, repeat, and shuffle do with TensorFlow Dataset?

Update: Here is a small collaboration notebook for demonstration of this answer. Imagine, you have a dataset: [1, 2, 3, 4, 5, 6], then: How ds.shuffle() works dataset.shuffle(buffer_size=3) will allocate a buffer of size 3 for picking random entries. This buffer will be connected to the source dataset. We could image it like this: Random … Read more

TensorFlow: How to measure how much GPU memory each tensor takes?

Now that 1258 has been closed, you can enable memory logging in Python by setting an environment variable before importing TensorFlow: import os os.environ[‘TF_CPP_MIN_VLOG_LEVEL’]=’3′ import tensorflow as tf There will be a lot of logging as a result of this. You’ll want to grep the results to find the appropriate lines. For example: grep MemoryLogTensorAllocation … Read more

Holding variables constant during optimizer

tf.stop_gradient(tensor) might be what you are looking for. The tensor will be treated as constant for gradient computation purposes. You can create two losses with different parts treated as constants. The other option (and often better) would be to create 2 optimizers but explicitly optimize only subsets of variables, e.g. train_a = tf.train.GradientDescentOptimizer(0.1).minimize(loss_a, var_list=[A]) train_b … Read more

tensorflow on GPU: no known devices, despite cuda’s deviceQuery returning a “PASS” result

From the log output, it looks like you are running the CPU version of TensorFlow (PyPI: tensorflow), and not the GPU version (PyPI: tensorflow-gpu). Running the GPU version would either log information about the CUDA libraries, or an error if it failed to load them or open the driver. If you run the following commands, … Read more

TensorFlow, why there are 3 files after saving the model?

Try this: with tf.Session() as sess: saver = tf.train.import_meta_graph(‘/tmp/model.ckpt.meta’) saver.restore(sess, “/tmp/model.ckpt”) The TensorFlow save method saves three kinds of files because it stores the graph structure separately from the variable values. The .meta file describes the saved graph structure, so you need to import it before restoring the checkpoint (otherwise it doesn’t know what variables … Read more

tech