tfrecord_mnist.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:TFExperiments 作者: gnperdue 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号