且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法使用 TensorFlow 0.7.1 在 TensorBoard 中可视化 Inception v3 模型

更新时间:2023-12-02 21:43:52

使用此代码:这对我有用:

Use this code: This works for me:

import tensorflow as tf
from tensorflow.python.platform import gfile
with tf.Session() as sess:
    model_filename ='YouGraphNameWithPath.pb'
    with gfile.FastGFile(model_filename, 'rb') as f:
        graph_def = tf.GraphDef()
        graph_def.ParseFromString(f.read())
        g_in = tf.import_graph_def(graph_def)
LOGDIR='PathWhereSummaryWillBeSaved'
train_writer = tf.summary.FileWriter(LOGDIR)
train_writer.add_graph(sess.graph)