tensorflow 的例子是 https://www.tensorflow.org/tutorials/audio/simple_audio
我想知道file_path
这个例子中的如下:
def get_waveform_and_label(file_path):
label = get_label(file_path)
audio_binary = tf.io.read_file(file_path)
waveform = decode_audio(audio_binary)
return waveform, label
'file_path' 在函数中被调用如下:
waveform_ds = files_ds.map(get_waveform_and_label, num_parallel_calls=AUTOTUNE)
我尝试使用 获取 file_path 的值print(file_path)
,但答案是Tensor("args_0:0", shape=(), dtype=string)
.
这不是 file_path 的确切值。
最后,我不知道 中的file_path
和输入参数的get_waveform_and_label
值waveform_ds = files_ds.map(get_waveform_and_label, num_parallel_calls=AUTOTUNE)
。