AttributeError: module 'tensorflow.python.summary.summary' has no attribute 'scalar'

1.8k views Asked by At

I've been trying to study tensorboard (from tensorflow (forked from github, using the latest version as well) and getting the above error whenever I use 'scalar' or 'histogram' functions. Why is the scalar function being pointed to tensorflow.python.summary.summary? (shouldn't it be tensorflow.python.summary?) Would be great if someone could help! I'm attaching the code here:

import tensorflow as tf
x = tf.Variable(tf.random_normal(5,5))
tf.summary.scalar('input', x)

The ouput is :

Traceback (most recent call last):
File "tensorboardetest.py", line 4, in <module>
tf.summary.scalar('input', x)
AttributeError: module 'tensorflow.python.summary.summary' has no attribute 'scalar'
1

There are 1 answers

0
chris On

You're not actually using the latest version of TensorFlow. :)