I was trying to install Chords Recognition and faced a series of errors but was finally able to get it to work. Wrote some bullet points to re-create incase I have to do it all over again, so putting that up here as a gist.
Final command to see it in action:
python3 realtime.py --category MirexRoot
OR
python3 realtime.py --category MirexMajMin
First clone and setup python environment:
python3 -m venv nenv
source venv/bin/activate
Install requirements manually: pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
^ This FAILED DUE TO h5py So ran: export HDF5_DIR="/opt/homebrew/Cellar/hdf5/1.13.0/" export CPATH="/opt/homebrew/include/" And did it again and it worked.
Packages missing after pip install -r requirements.txt from inside chords-recognition clone:
pip3 install torch pip3 install sklearn
pip3 install pyaudio ^ Gave error, resolved by running: python3 -m pip install --global-option='build_ext' --global-option='-I/opt/homebrew/Cellar/portaudio/19.7.0/include' --global-option='-L/opt/homebrew/Cellar/portaudio/19.7.0/lib' pyaudio
librosa:
librosa depends on llvmlite, which builds successfully using: brew install llvmlite@11 env LLVM_CONFIG=/opt/homebrew/Cellar/llvm@11/11.1.0_4/bin/llvm-config pip3 install llvmlite
Then pip3 install librosa
worked.
pip3 install scipy
After all this, still got an error saying it requires numpy<1.22,>=1.18
,
Fixed by manually removing the exception itself from chords-recognition/venv/site-packages/numba/init.py (removed L137-140) and ran the final command again.
This time, no numpy error, it picked up the scipy and worked, except some double conversion error like:
RuntimeError: expected scalar type Float but found Double
Traceback (most recent call last):
File "realtime.py", line 85, in <module>
predict_stream()
File "realtime.py", line 63, in predict_stream
sleep(0.25)
RuntimeError
Fixed this by opening, realtime.py from the root and changed float32 to double at L30.
Ran the final command again and it started to predict it well.
Here's a video demo using my Guitar (I play G-D-C-G-D-Emin-G) using python3 realtime.py --category MirexMajMin