从多个tfrecord文件中无限读取文件的例子
时间:2021-05-17 08:40:56|栏目:Python代码|点击: 次
原来在一本书上看到过,从多个tfrecord文件中读取数据的方法,今天想用在网上找了一下,现在记录一下,免得自己以后忘记了又不好找,
tfrecord_file_path = '/train/*.tfrecords'#train是存放tfrecord的文件夹
filename_queue = tf.train.string_input_producer(
tf.train.match_filenames_once(tfrecord_file_path),
shuffle=True, num_epochs=None) #None表示没哟限制
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue) #返回文件名和文件
features = tf.parse_single_example(serialized_example,
features={XXXXXXX}) #取出XXXXXXX
栏 目:Python代码
下一篇:linux centos 7.x 安装 python3.x 替换 python2.x的过程解析
本文地址:http://www.codeinn.net/misctech/123207.html






