【发布时间】:2019-09-23 15:30:23
【问题描述】:
我正在使用多个 tfRecord 文件并希望从中读取以创建数据集。我正在尝试使用路径 from_tensor_slices 并使用该数据集进一步读取 TFRecords
(多tfRecords的优势:https://datascience.stackexchange.com/questions/16318/what-is-the-benefit-of-splitting-tfrecord-file-into-shards)
我想知道是否有更简单且经过验证的方法来做到这一点。
file_names_dataset = tf.data.Dataset.from_tensor_slices(filenames_full)
def read(inp):
return tf.data.TFRecordDataset(inp)
file_content = file_names.map(read)
我的下一步是使用 tf.io.parse_single_example 解析数据集。
【问题讨论】:
标签: tensorflow-datasets tensorflow2.0