[英]Librosa and Numba in Python
我正在體驗 numba 以加快我的代碼速度,我在此代碼中遇到錯誤
@njit
def fee(x):
chroma_stft = librosa.feature.chroma_stft(y=data, sr=sampling_rate).ravel()
return(chroma_stft)
TypingError: Failed in nopython mode pipeline (step: nopython frontend) Unknown attribute 'chroma_stft' of type Module(<module 'librosa.feature' from '/usr/local/lib/python3.7/dist-packages/librosa/feature/__init__.py'>)
如何解決這個問題,有沒有辦法在 numba 中使用 scipy.stats 函數?
謝謝
該錯誤意味着 Numba 無法在nopython( @jit(nopython=True)
)模式( @njit
是其別名)下 JIT function。
您需要使用常規的@jit
,但加速很可能不會那么劇烈。
同樣代表scipy.stats
,很可能。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.