从多个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

猜你喜欢

转载自blog.csdn.net/chanbo8205/article/details/85703719
今日推荐