tensorflow tf.Print not printing anything in Jupyter -
trying debug statements in python/tensorflow1.0 using jupyter , not output printed tf.print
thought sess.run(during training in below code) should have evaluated db1 tensor , print output did not happen db1.eval in evaluate phase , printing entire tensor x out "message x:".
def combine_inputs(x): db1=tf.print(x,[x],message='x:') return (tf.matmul(x, w) + b,db1) <<training code>> _,summary=sess.run([train_op,merged_summaries]) ## merged_summaries tensor triggers combine_inputs function. there ## other tensor functions/coding in between , not giving entire code keep ## simple; code works expected except tf.print <<evaluate code>> print(db1.eval()) confused on following a) why tf.print not printing during sess.run during training? b) why explicit db1.eval necessary , expected tf.print trigger sess.run. if eval required , copy tensor x in code db1 , evaluate out tf.print. correct?
tried going through other questions (like below one). suggested implement memory_util or predefined function. learner not understand why tf.print not work in scenario
if encountered similar issues , please assist. thanks!
according documentation, tf.print prints standard error (as of version 1.1), , it's not compatible jupyter notebook. that's why can't see output.
check here: https://www.tensorflow.org/api_docs/python/tf/print
Comments
Post a Comment