问题
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