def _read_example(filename_queue, n_labels=50, n_samples=59049):
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue)
features = tf.parse_single_example(
serialized_example,
features={
'raw_labels': tf.FixedLenFeature([], tf.string),
'raw_segment': tf.FixedLenFeature([], tf.string)
})
segment = tf.decode_raw(features['raw_segment'], tf.float32)
segment.set_shape([n_samples])
labels = tf.decode_raw(features['raw_labels'], tf.uint8)
labels.set_shape([n_labels])
labels = tf.cast(labels, tf.float32)
return segment, labels
评论列表
文章目录