Warning message using Chroma - "Trying to estimate tuning from empty frequency set."

604 views
Skip to first unread message

Good Robot

unread,
Mar 6, 2022, 10:07:10 PM3/6/22
to librosa
Hello,

I am using the command:

chroma_d = librosa.feature.chroma_stft(y=audio, sr=sample_rate)

Can you tell me what could cause the warning message:

\Python\lib\site-packages\librosa\core\pitch.py:146: UserWarning: Trying to estimate tuning from empty frequency set.
         warnings.warn('Trying to estimate tuning from empty frequency set.')

I think this warning message is causing my "alive_bar" to get stuck

My usage is extracting Chroma features using the line above, from labeled data, read from a csv file.

Let me know what other information you may require to help with an answer to this question as it is causing my alive_bar status to get stuck in PyCharm:

with alive_bar(items, force_tty=True) as bar:

Thanks!

Brian McFee

unread,
Mar 7, 2022, 8:24:34 AM3/7/22
to librosa
This happens when trying to estimate tuning from a signal that lacks prominent spectral peaks.  It is only a warning (not an error), and it cannot cause your progress bar to get stuck.

Mason Wang

unread,
Sep 8, 2025, 3:49:07 PM (2 days ago) Sep 8
to librosa
Hello Professor,

Thank you for this insightful response!
I am getting this issue too. While it does not get stuck it does slow down quite a bit when this happens. What is the reason for this?

Best,
Mason

Brian McFee

unread,
Sep 8, 2025, 3:50:37 PM (2 days ago) Sep 8
to librosa
There's nothing in the code path that leads to this warning that would incur additional computation.  If it's slowing down, that's unrelated, and probably running into jit compilation (or perhaps a heavy lazy import).
Reply all
Reply to author
Forward
0 new messages