Audio-to-midi icon indicating copy to clipboard operation
Audio-to-midi copied to clipboard

Python Error

Open J0R0W opened this issue 4 years ago • 6 comments

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`

J0R0W avatar Oct 09 '20 11:10 J0R0W

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

jain-sah avatar Jul 15 '21 04:07 jain-sah

I created a venv with python 3.6 and problem gone.

lebretou avatar Jul 23 '21 05:07 lebretou

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

zxy2004 avatar Mar 21 '22 03:03 zxy2004

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.

interestingLSY avatar May 17 '22 07:05 interestingLSY

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)

Zulex avatar Jun 02 '22 15:06 Zulex

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

drscotthawley avatar Apr 14 '24 22:04 drscotthawley