def read_and_decode(filename_queue):
reader = tf.TFRecordReader()
_, serialized_example = reader.read(filename_queue)
features = tf.parse_single_example(serialized_example, features={
'song_spec': tf.FixedLenFeature([], tf.string),
'voice_spec': tf.FixedLenFeature([], tf.string),
'mixed_spec': tf.FixedLenFeature([], tf.string)
})
song_spec = transform_spec_from_raw(features['song_spec'])
voice_spec = transform_spec_from_raw(features['voice_spec'])
mixed_spec = transform_spec_from_raw(features['mixed_spec'])
input_spec = stack_spectrograms(mixed_spec) # this will be the input
target_spec = tf.concat([song_spec, voice_spec], axis=1) # target spec is going to be a concatenation of song_spec and voice_spec
return input_spec, target_spec
评论列表
文章目录