You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
x, _ = librosa.core.load(dataset_path + "test.wav", sr=16000, mono=True)
x = x[26000:40000]
wa = WaveletAnalysis(sig, dt=0.1)
print(wa.reconstruction().shape)
An error occurred during runtime:
File "\wavelets\transform.py", line 85, in cwt
return cwt_time(data, wavelet, widths, dt, axis)
File "\wavelets\transform.py", line 105, in cwt_time
wavelet_data[slices],
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
Because there is an error in your source code, as shown below,
def cwt_time(data, wavelet, widths, dt, axis):
# wavelets can be complex so output is complex
......
wavelet_data = norm * wavelet(t, width)
output[ind, :] = scipy.signal.fftconvolve(data,
wavelet_data[slices],
mode='same')
return output
it should be corrected in this way. Obviously, the sequence value operation is missing:
def cwt_time(data, wavelet, widths, dt, axis):
# wavelets can be complex so output is complex
......
wavelet_data = norm * wavelet(t, width)
output[ind, :] = scipy.signal.fftconvolve(data,
wavelet_data[slices[axis]],
mode='same')
return output
The text was updated successfully, but these errors were encountered:
ZhaoKe1024
changed the title
A program error that can cause running bugs
A program error that can cause "IndexError: only integers, ...... are valid indices"
Dec 28, 2023
This repo is abandoned, see my fork and let me know if it has the same problem
I just took a look, your program in new repo is correct which added an extra line "slices = tuple(slices)" than the original program, so corrected the error, thanks!
my program is as follows:
An error occurred during runtime:
Because there is an error in your source code, as shown below,
it should be corrected in this way. Obviously, the sequence value operation is missing:
The text was updated successfully, but these errors were encountered: