Coder Social home page Coder Social logo

meetps / crnn-music-genre-classification Goto Github PK

View Code? Open in Web Editor NEW
53.0 8.0 18.0 2.72 MB

Tensorflow Implementation of Convolutional Recurrent Neural Networks for Music Genre Classification

Python 100.00%
music-genre-classification deep-learning speech-tagger convolutional-neural-networks recurrent-neural-networks

crnn-music-genre-classification's Introduction

crnn-music-genre-classification

arXiv Tag

Music Genre Classification using Convolutional Recurrent Neural Networks

Data

  • Download GENRE data from Marsyas
  • Extract the tarball in the directory which contains the cloned repo.

Running the code

CNN

  • python cnn.py

CRNN

  • python crnn.py

crnn-music-genre-classification's People

Contributors

meetps avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crnn-music-genre-classification's Issues

obtain a not ideal result

ask for help
why set to n_samples=1000 , my result auc gradually decrease,
and the loss is printed every batch_size, I find the loss not decreasing
my python version is 3.6, tensorflow version is 1.4.
and the code can run correctly,

read_data.py

labels = pd.read_csv(labels_file,header=0)
showing the error while reading the file.
Please help to rectify it.

crnn.py dynamic_rnn runtime error : ValueError

Hi

I have runtime error for execution crnn.py

My env :
OS : Windows 7
Python 3.5.3 Anaconda

Any solution to fix it ?


crnn.py line 67

gru1_out, state = tf.nn.dynamic_rnn (gru1, gru1_in, dtype=tf.float32, scope='gru1')

ValueError: Trying to share variable gru1/multi_rnn_cell/cell_0/gru_cell/gates/kernel,
but specified shape (64, 64) and found shape (160, 64).

crnn.py

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

cnn.py prints AUC : 1.0 for all epoch ?

Hi

Thanks for your code.

I executed this code for cnn.py

All epoch print "AUC : 1.0" from start step to end step.

And,
for argmax mean, all epoch print "0.0"

Is this a good execution result ?

My Env is below :
Python 3.5.3
Anaconda 64 bit
Windows 7 64bit

error out of memory when n_samples=1000

W tensorflow/core/common_runtime/bfc_allocator.cc:275] Ran out of memory trying to allocate 6.59GiB. See logs for memory state.
W tensorflow/core/framework/op_kernel.cc:993] Resource exhausted: OOM when allocating tensor with shape[200,64,96,1440]
Traceback (most recent call last):
File "crnn.py", line 144, in
predictions = sess.run(predict_op, feed_dict=test_input_dict)
File "/home/ubuntu/anaconda3/envs/tf_1.0.1_py_2.7/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 767, in run
run_metadata_ptr)
File "/home/ubuntu/anaconda3/envs/tf_1.0.1_py_2.7/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 965, in _run
feed_dict_string, options, run_metadata)
File "/home/ubuntu/anaconda3/envs/tf_1.0.1_py_2.7/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1015, in _do_run
target_list, options, run_metadata)
File "/home/ubuntu/anaconda3/envs/tf_1.0.1_py_2.7/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 1035, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[200,64,96,1440]
[[Node: Conv2D = Conv2D[T=DT_FLOAT, data_format="NHWC", padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/gpu:0"](Reshape_1, Variable/read)]]
[[Node: Sigmoid/_87 = _Recvclient_terminated=false, recv_device="/job:localhost/replica:0/task:0/cpu:0", send_device="/job:localhost/replica:0/task:0/gpu:0", send_device_incarnation=1, tensor_name="edge_249_Sigmoid", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/cpu:0"]]

I can't train with the whole dataset, even 500 samples.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.