tensorflow :ValueError: GraphDef cannot be larger than 2GB

倖福魔咒の 提交于 2019-12-11 19:32:26

问题


I want to run tensorflow code as follows:

# 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)

after wait a long time,the console hints me the error:

ValueError: GraphDef cannot be larger than 2GB. the error code line is

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

from the console hints,it seems graph size is large than 2GB. How can I solve the problem?

来源:https://stackoverflow.com/questions/55311269/tensorflow-valueerror-graphdef-cannot-be-larger-than-2gb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!