def examine_batches(features_batch, targets_batch):
with tf.Session() as sess:
sess.run(tf.local_variables_initializer())
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(coord=coord)
try:
for it in range(5000):
features, targets = sess.run([features_batch, targets_batch])
if it % 100 == 0:
LOGGER.debug(it)
LOGGER.debug(
len(features),
features[0].shape,
np.max(features[0][0][7][:])
)
LOGGER.debug(np.argmax(targets, axis=1))
except tf.errors.OutOfRangeError:
LOGGER.info('Training stopped - queue is empty.')
except Exception as e:
LOGGER.error(e)
finally:
coord.request_stop()
coord.join(threads)
评论列表
文章目录