jsalbert / Music-Genre-Classification-with-Deep-Learning

Using deep learning to predict the genre of a song.
https://jsalbert.github.io/Music-Genre-Classification-with-Deep-Learning/
MIT License
146 stars 36 forks source link

cannot run "quick_test.py" #2

Closed DAKSHSEMWAL closed 1 year ago

DAKSHSEMWAL commented 6 years ago

while running quicktest.py Using TensorFlow backend.

Traceback (most recent call last): File "I:\Coding\Music-Genre-Classification-with-Deep-Learning-master\quick_test.py", line 1, in from keras import backend as K File "C:\Python27\lib\site-packages\keras__init.py", line 2, in from . import backend File "C:\Python27\lib\site-packages\keras\backend\init__.py", line 64, in from .tensorflow_backend import * File "C:\Python27\lib\site-packages\keras\backend\tensorflow_backend.py", line 1, in import tensorflow as tf ImportError: No module named tensorflow but tensorflow does not support python2.7.14

jsalbert commented 6 years ago

Hello, it seems that you don't have tensorflow installed. If you read the pre-requisites you will see how to create an environment and install there the project library dependencies.

# Create environment
 virtualenv env_song
 # Activate environment
 source env_song/bin/activate
 # Install dependencies
 pip install -r requirements.txt

Also this project is a bit old now and it was made with Keras version 1, running over Theano, not Tensorflow. In requirements.txt you can see the specific version that was used. Not sure if it will run with the newest versions. Here it is shown how to change the backend that Keras is using.

pandey1996 commented 6 years ago

try sudo pip install --upgrade tensorflow worked for me at that part having issues later though

Seedak commented 4 years ago

Hi, I am trying to run quick_test.py with theano as backend for keras and i am getting this error Please Help

Traceback (most recent call last): File "C:/Users/t/PycharmProjects/Music-Genre-Classification-with-Deep-Learning-master/quick_test.py", line 47, in X_test, num_frames_test = extract_melgrams(test_songs_list, MULTIFRAMES, process_all_song=False, num_songs_genre='') File "C:\Users\t\PycharmProjects\Music-Genre-Classification-with-Deep-Learning-master\utils.py", line 111, in extract_melgrams melgram = ap.compute_melgram_multiframe(song_path, process_all_song) File "C:\Users\t**\PycharmProjects\Music-Genre-Classification-with-Deep-Learning-master\audio_processor.py", line 99, in compute_melgram_multiframe n_fft=N_FFT, n_mels=N_MELS) 2, File "C:\Users\t**\venv\lib\site-packages\librosa\feature\spectral.py", line 1371, in melspectrogram mel_basis = filters.mel(sr, n_fft, kwargs) File "C:\Users\t****\venv\lib\site-packages\librosa\filters.py", line 238, in mel lower = -ramps[i] / fdiff[i] ValueError: operands could not be broadcast together with shapes (1,257) (0,)

leon0514 commented 4 years ago

Hi, I am trying to run quick_test.py with theano as backend for keras and i am getting this error Please Help

Traceback (most recent call last): File "C:/Users/t/PycharmProjects/Music-Genre-Classification-with-Deep-Learning-master/quick_test.py", line 47, in X_test, num_frames_test = extract_melgrams(test_songs_list, MULTIFRAMES, process_all_song=False, num_songs_genre='') File "C:\Users\t\PycharmProjects\Music-Genre-Classification-with-Deep-Learning-master\utils.py", line 111, in extract_melgrams melgram = ap.compute_melgram_multiframe(song_path, process_all_song) File "C:\Users\t**\PycharmProjects\Music-Genre-Classification-with-Deep-Learning-master\audio_processor.py", line 99, in compute_melgram_multiframe n_fft=N_FFT, n_mels=N_MELS) 2, File "C:\Users\t**\venv\lib\site-packages\librosa\feature\spectral.py", line 1371, in melspectrogram mel_basis = filters.mel(sr, n_fft, kwargs) File "C:\Users\t****\venv\lib\site-packages\librosa\filters.py", line 238, in mel lower = -ramps[i] / fdiff[i] ValueError: operands could not be broadcast together with shapes (1,257) (0,)

I got the same error,do you have any solution for this problem?