Skip to content

tf.print can't print log in jupyter notebook.  #24686

@lyhue1991

Description

@lyhue1991

When I tried to use tf.print() or get the log_device_placement information in google colabratory. I just can't get the print output. I tried in my own jupyter, and I find the print log is in the cmd.exe windows. This behavior is very strange and I think it should be fixed. The code is like below.

import tensorflow as tf
print(tf.GIT_VERSION, tf.VERSION)
a = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[2, 3], name='a')
b = tf.constant([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], shape=[3, 2], name='b')
c = tf.matmul(a, b)
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
print(sess.run(c))

the print output is just like this:

v1.12.0-0-ga6d8ffae09 1.12.0
[[22. 28.]
[49. 64.]]

but it should be with the log_device_placement information.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions