I'm getting this error, although everywhere I've looked file_writer = tf.summary.FileWriter('/path/to/logs', sess.graph)
is mentioned as the correct implementation of this and this.
Here is the error:
Traceback (most recent call last): File "tfvgg.py", line 304, in writer = tf.summary.FileWriter("/tmp/tfvgg", sess.graph) AttributeError: module 'tensorflow.python.summary.summary' has no attribute 'FileWriter'
Here is the code I'm using:
# init
sess = tf.Session()
writer = tf.summary.FileWriter("/tmp/tfvgg", sess.graph)
init = tf.initialize_all_variables()
sess.run(init)
Has there been a change to the correct way to use FileWriter
as there has been with other summary
methods?
For future reference of anyone in the same situation, changing tf.summary.FileWriter()
to tf.train.SummaryWriter()
solved this issue and allowed for graph visualisation in Tensorboard. As I thought, it seems like FileWriter
may be deprecated (although it does oddly still appear when searching through tf
methods in the IDE)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With