batch_inputs.py 文件源码

python
阅读 57 收藏 0 点赞 0 评论 0

项目:sample-cnn 作者: tae-jun 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号