网络编程
位置:首页>> 网络编程>> Python编程>> 从多个tfrecord文件中无限读取文件的例子

从多个tfrecord文件中无限读取文件的例子

作者:古月光军001  发布时间:2023-10-23 13:29:19 

标签:tfrecord,读取文件

原来在一本书上看到过,从多个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

来源:https://blog.csdn.net/CSDNbaiduyun/article/details/81537837

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com