参考此链接: https ://aqibsaeed.github.io/2016-09-03-urban-sound-classification-part-1/,我试图制作相同的波形图,但是,我通过运行代码。 py,出现错误:
(tensorflow) yyydeMacBook-Pro:~ yyy$ python /Users/yyy/Desktop/1.py
Traceback (most recent call last):
File "/Users/yyy/Desktop/1.py", line 82, in <module>
plot_waves(sound_names,raw_sounds)
File "/Users/yyy/Desktop/1.py", line 42, in plot_waves
librosa.display.waveplot(np.array(f),sr=22050)
AttributeError: 'module' object has no attribute 'display'
原文由 Yiin 发布,翻译遵循 CC BY-SA 4.0 许可协议
从这个 github问题 我读到现在有必要
import librosa.display
。[更新 2022] 显然现在也
waveplot
需要更改为waveshow
,如下所示:( 感谢 Hammad Hassan 的评论!)