def inputs_test(filename, batch_size, num_epochs, num_threads,
imshape, num_examples_per_epoch=128):
tf.local_variables_initializer()
if not num_epochs:
num_epochs = None
with tf.name_scope('input'):
filename_queue = tf.train.string_input_producer(
[filename], num_epochs=num_epochs, name='string_input_producer')
image, label = reader.read_and_decode_wholefile(filename_queue, imshape, normalize=True)
images, sparse_labels = tf.train.batch([image, label], batch_size=batch_size)
return images, sparse_labels
评论列表
文章目录