Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Python Error #3

Open
J0R0W opened this issue Oct 9, 2020 · 6 comments
Open

Python Error #3

J0R0W opened this issue Oct 9, 2020 · 6 comments

Comments

@J0R0W
Copy link

J0R0W commented Oct 9, 2020

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
Copy link

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

@lebretou
Copy link

I created a venv with python 3.6 and problem gone.

@AirFortressIlikara
Copy link

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

@interestingLSY
Copy link

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
Copy link

Zulex commented Jun 2, 2022

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
Copy link

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants