-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: 'float' object cannot be interpreted as an integer #106
Labels
Comments
Besides, after I change the code to
It will also get an error like this: traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.1\plugins\python-ce\helpers\pydev\pydevd.py", line 1448, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.2.1\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "D:/music/tools/msaf/test_msaf.py", line 14, in <module>
boundaries, labels = msaf.process(audio_file, feature=feature, boundaries_id=bid, framesync=True, labels_id=lid, config=config)
File "C:\Users\v-zeju\src\lib\site-packages\msaf\run.py", line 342, in process
est_times, est_labels = run_algorithms(file_struct, boundaries_id,
File "C:\Users\v-zeju\src\lib\site-packages\msaf\run.py", line 214, in run_algorithms
est_times, est_labels = run_fun(file_struct, bounds_module, labels_module,
File "C:\Users\v-zeju\src\lib\site-packages\msaf\run.py", line 138, in run_flat
est_idxs, est_labels = S.processFlat()
File "C:\Users\v-zeju\src\lib\site-packages\msaf\algorithms\sf\segmenter.py", line 188, in processFlat
est_bounds /= red
TypeError: ufunc 'true_divide' output (typecode 'd') could not be coerced to provided output parameter (typecode 'l') according to the casting rule ''same_kind'' Due to the code: if self.framesync:
est_bounds /= red
F = F_copy |
Oh, thanks for reporting! I believe this should fix it: if self.framesync:
est_bounds = np.asarray(est_bounds // red, dtype=np.int)
F = F_copy If this works, would you mind creating a PR with these changes? Thanks! |
This was fixed here: #107 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
HI, I found this code in msaf/msaf/algorithms/sf/segmenter.py
may cause bug because
I test on librosa=0.8.0 and numpy=1.19.3 and will get this error:
The text was updated successfully, but these errors were encountered: