为什么tf.train.MonitoredTrainingSession
没有接收图形作为参数?
tf.Session
(以及tf.train.Supervisor
)可以执行以下操作:
with tf.Graph().as_default() as g:
# Build computation graph...
with tf.Session(graph=g) as sess:
# Run operations...
建议只采用如下的写作方式?
with tf.Graph().as_default() as g:
# Build computation graph...
with tf.train.MonitoredTrainingSession(...) as mon_sess:
# Run operations...