tensorflow:ValueError:GraphDef不能大于2GB

时间:2019-03-23 06:37:14

标签: tensorflow valueerror

我想按如下方式运行张量流代码:

# Construct graph
g = Graph("train"); print("Graph loaded")
# Start session
sv = tf.train.Supervisor(graph=g.graph,logdir="/workspace",save_model_secs=0)
with sv.managed_session() as sess:
    for epoch in range(1, 10): 
        if sv.should_stop(): break
        for step in tqdm(range(g.num_batch), total=g.num_batch, ncols=70, 
            leave=False, unit='b'):
            sess.run(g.train_op)

等待很长时间后,控制台会提示我错误:

ValueError:GraphDef不能大于2GB。 错误代码行是

  sv=tf.train.Supervisor(graph=g.graph,logdir="/workspace",save_model_secs=0)

从控制台提示来看,似乎图形大小大于2GB。我该如何解决这个问题?

0 个答案:

没有答案