meetps / crnn-music-genre-classification

Tensorflow Implementation of Convolutional Recurrent Neural Networks for Music Genre Classification
53 stars 18 forks source link

crnn.py #4

Closed DAKSHSEMWAL closed 1 year ago

DAKSHSEMWAL commented 6 years ago

on running crnn.py iam getting this error I:\Coding\crnn-music-genre-classification-master\src>python crnn.py C:\Users\dsemw\AppData\Local\Programs\Python\Python36\lib\site-packages\h5py__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Traceback (most recent call last): File "crnn.py", line 94, in X_test = rd.get_melspectrograms_indexed(test_indices) File "I:\Coding\crnn-music-genre-classification-master\src\read_data.py", line 25, in get_melspectrograms_indexed spectrograms = np.asarray([dp.log_scale_melspectrogram(i) for i in labels_dense['path'][index]]) File "I:\Coding\crnn-music-genre-classification-master\src\read_data.py", line 25, in spectrograms = np.asarray([dp.log_scale_melspectrogram(i) for i in labels_dense['path'][index]]) File "I:\Coding\crnn-music-genre-classification-master\src\data_preprocess.py", line 21, in log_scale_melspectrogram signal = signal[(n_sample-n_sample_fit)/2:(n_sample+n_sample_fit)/2] TypeError: slice indices must be integers or None or have an index method

Nidi9195 commented 6 years ago

The indices in this line: signal = signal[(n_sample-n_sample_fit)/2:(n_sample+n_sample_fit)/2] might be computed as float. Ensure they are int maybe by: signal[int((n_sample-n_sample_fit)/2):int((n_sample+n_sample_fit)/2)]