Music-Genre-Classification-with-Deep-Learning icon indicating copy to clipboard operation
Music-Genre-Classification-with-Deep-Learning copied to clipboard

cannot run "quick_test.py"

Open DAKSHSEMWAL opened this issue 7 years ago • 4 comments

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

DAKSHSEMWAL avatar Feb 09 '18 20:02 DAKSHSEMWAL

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.

jsalbert avatar Feb 10 '18 16:02 jsalbert

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

pandey1996 avatar Feb 23 '18 19:02 pandey1996

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,)

Seedak avatar Apr 20 '20 13:04 Seedak

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?

leon0514 avatar May 06 '20 08:05 leon0514