bill317996 / Audio-to-midi

An application of vocal melody extraction.
MIT License
54 stars 12 forks source link

Python Error #3

Open J0R0W opened 3 years ago

J0R0W commented 3 years ago

While exceuting, i get following error: `Audio to midi : Update in 20190503

input_folder: ./input/ output_folder: ./output/ melody_type: Vocal

Songname: train01 Traceback (most recent call last): File "audio2midi.py", line 305, in main(fp, mp, op) File "audio2midi.py", line 249, in main W, Time_arr, Freq_arr = feature_ext(file_path) File "audio2midi.py", line 182, in feature_ext Z, Time_arr, Freq_arr, tfrL0, tfrLF, tfrLQ = cfp.feature_extraction(y, sr, Hop=512, StartFreq=32.7, StopFreq=2093.0, NumPerOct=48) File "/mnt/f/Users/JonasR/Downloads/Audio-to-midi-master/cfp.py", line 208, in feature_extraction tfrL0, tfrLF, tfrLQ, f, q, t, CenFreq = CFP_filterbank(x, fr, fs, Hop, h, StartFreq, 1/StopFreq, g, NumPerOct) File "/mnt/f/Users/JonasR/Downloads/Audio-to-midi-master/cfp.py", line 141, in CFP_filterbank [tfr, f, t, N] = STFT(x, fr, fs, Hop, h) File "/mnt/f/Users/JonasR/Downloads/Audio-to-midi-master/cfp.py", line 55, in STFT f = fs*np.linspace(0, 0.5, np.round(N/2), endpoint=True) File "<__array_function__ internals>", line 5, in linspace File "/usr/local/lib/python3.8/dist-packages/numpy/core/function_base.py", line 113, in linspace num = operator.index(num) TypeError: 'numpy.float64' object cannot be interpreted as an integer`

jain-sah commented 3 years ago

Getting the same error = numpy.float64' object cannot be interpreted as an integer

lebretou commented 3 years ago

I created a venv with python 3.6 and problem gone.

zxy2004 commented 2 years ago

pip install numpy==1.16.0 numpy版本太高了

interestingLSY commented 2 years ago

In cfp.py, line 55, add .astype(int) after np.round(N/2). This works for me. I'm using python 3.9 with the latest numpy.

Zulex commented 2 years ago

Could someone note the versions of scipy and pianoroll that were used> As I am getting errors with those too. Would appreciate it a lot!

(fftpack & multitrack)

drscotthawley commented 5 months ago

@interestingLSY thank you that works @Zulex I ran pip install pypianoroll==0.5.3 and that resolved my issues.