Graph visualisaton is not showing in tensorboard f

2019-04-11 20:14发布

问题:

I build a seq2seq model using the seq2seq.py library provided with tensorflow. Before training anything I wanted to visualize the graph network of my untrained model in tensorboard, but it does not want to display this.

Below a minimal example to reproduce my problem. Anybody an idea why this does not work? Can you only visualize a grap of a model after it has been trained?

import tensorflow as tf
import numpy as np
from tensorflow.models.rnn import rnn_cell
from tensorflow.models.rnn import seq2seq

encoder_inputs = []
decoder_inputs = []

for i in xrange(350):  
    encoder_inputs.append(tf.placeholder(tf.float32, shape=[None,2],
                                              name="encoder{0}".format(i)))

for i in xrange(45):
    decoder_inputs.append(tf.placeholder(tf.float32, shape=[None,22],
                                         name="decoder{0}".format(i)))

size = 512 # number of hidden units
num_layers = 2 # Number of LSTMs
single_cell = rnn_cell.BasicLSTMCell(size)
cell = rnn_cell.MultiRNNCell([single_cell] * num_layers)
model = seq2seq.basic_rnn_seq2seq(encoder_inputs, decoder_inputs,cell)

sess = tf.Session()
sess.run(tf.variables.initialize_all_variables())
summary_writer = tf.train.SummaryWriter('/path/to/log', graph_def = sess.graph_def)

回答1:

It looks like this might be related to a bug where the graph visualization does not work in the firefox browser. Try using chrome or safari if possible.

https://github.com/tensorflow/tensorflow/issues/650