seq2seq模型的张量图中未显示图visualisaton [英] Graph visualisaton is not showing in tensorboard for seq2seq model

查看:95
本文介绍了seq2seq模型的张量图中未显示图visualisaton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用tensorflow提供的seq2seq.py库构建seq2seq模型. 在训练任何东西之前,我想在张量板上可视化未训练模型的图形网络,但是它不想显示它.

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)

推荐答案

这似乎与一个错误有关,该错误导致图形可视化在firefox浏览器中不起作用.如果可能,请尝试使用chrome或safari.

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

这篇关于seq2seq模型的张量图中未显示图visualisaton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆