keunwoochoi / transfer_learning_music Goto Github PK
View Code? Open in Web Editor NEWTransfer learning for music classification and regression tasks
Transfer learning for music classification and regression tasks
Hi, I am trying to use this package. Thanks for this tool.
But I am facing little problem while using this package.
I am trying to use the following command to run :
python easy_feature_extraction.py ballroom_extended.csv features.npy 8
in the csv file I have provided the name and location of the audio files. I am using wav file instead of mp3 files though. And the audio files are not in the same folder as the code, so i hard-coded the audio file paths in the csv file, e.g, '/home/Desktop/audio/first.wav' But it is giving me some error while running the code
IOError: [Errno 2] No such file or directory: '/home/rahulp/Desktop/transfer_learning_music-master/,id,filepath,label\r'
Loading/extracting 4,subject06_2(Seg1)_5+5 ,/home/rahulp/Desktop/audio_seg/s...ect06_2(Seg1)_5+5.wav ,0
One thing to note is id,filepath and label were the headings of the csv file as shown in your data_csv folder. Why it is trying to find id,filepath,label as a file, Can you please help?
Thanks in advance
Hi, I am trying n_hop = 512, but, I get an error during Flatten()
Could you help me?
Can You Please Help:
Traceback (most recent call last):
File "easy_feature_extraction.py", line 105, in
main(txt_path, out_path, n_jobs)
File "easy_feature_extraction.py", line 73, in main
models = [load_model(mid_idx) for mid_idx in range(5)] # for five models...
File "easy_feature_extraction.py", line 27, in load_model
model = build_convnet_model(args, last_layer=False)
File "I:\Coding\transfer_learning_music-master\models_transfer.py", line 35, in build_convnet_model
last_layer=last_layer, sr=sr)
File "I:\Coding\transfer_learning_music-master\models_transfer.py", line 79, in raw_vgg
name='melgram'))
File "C:\Users\dsemw\vr2\lib\site-packages\kapre-0.1.2.1-py2.7.egg\kapre\time_frequency.py", line 256, in init
super(Melspectrogram, self).init(**kwargs)
File "C:\Users\dsemw\vr2\lib\site-packages\kapre-0.1.2.1-py2.7.egg\kapre\time_frequency.py", line 86, in init
self.image_data_format = K.image_data_format()
AttributeError: 'module' object has no attribute 'image_data_format'
the pip packagers I have installed are
appdirs (1.4.3)
audioread (2.1.5)
cycler (0.10.0)
Cython (0.25.2)
decorator (4.2.1)
enum34 (1.1.6)
ffmpy (0.2.2)
funcsigs (1.0.2)
functools32 (3.2.3.post2)
future (0.16.0)
h5py (2.7.0)
joblib (0.11)
kapre (0.1.2.1)
Keras (1.2.2)
librosa (0.5.1)
llvmlite (0.21.0)
matplotlib (2.0.0)
mistune (0.8.3)
numba (0.36.2)
numpy (1.14.0)
packaging (16.8)
pandas (0.22.0)
pip (9.0.1)
pyparsing (2.2.0)
python-dateutil (2.6.1)
pytz (2018.3)
PyYAML (3.12)
resampy (0.2.0)
scikit-learn (0.19.1)
scipy (1.0.0)
setuptools (38.5.1)
singledispatch (3.4.0.3)
six (1.11.0)
subprocess32 (3.2.7)
Theano (1.0.1)
I am trying to run the instruction of the firts part but i am getting the error of the title.
Full error:
Traceback (most recent call last):
File "easy_feature_extraction.py", line 107, in
main(txt_path, out_path, 1)
File "easy_feature_extraction.py", line 78, in main
all_features = predict_cpu(f_path, models, n_jobs)
File "easy_feature_extraction.py", line 70, in predict_cpu
features = pool.map(_predict_one, arg_gen)
File "/Users/irisren/anaconda/lib/python2.7/multiprocessing/pool.py", line 251, in map
return self.map_async(func, iterable, chunksize).get()
File "/Users/irisren/anaconda/lib/python2.7/multiprocessing/pool.py", line 567, in get
raise self._value
ValueError: CorrMM images and kernel must have the same stack size
Any ideas why?
Hi,
I've been trying to get your feature extractor to work but I'm running into issues. First, the program requires 3 input arguments instead of 2, as mentioned in the README. The third input argument is for the number of workers to do the feature computation.
After I figured this out, I ran into this error:
Traceback (most recent call last):
File "easy_feature_extraction.py", line 105, in <module>
main(txt_path, out_path, n_jobs)
File "easy_feature_extraction.py", line 76, in main
all_features = predict_cpu(f_path, models, n_jobs)
File "easy_feature_extraction.py", line 68, in predict_cpu
features = pool.map(_predict_one, arg_gen)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 251, in map
return self.map_async(func, iterable, chunksize).get()
File "/usr/lib/python2.7/multiprocessing/pool.py", line 567, in get
raise self._value
ValueError: CorrMM images and kernel must have the same stack size
Apply node that caused the error: CorrMM{half, (1, 1), (1, 1)}(Elemwise{Composite{maximum((i0 - i1), i2)}}[(0, 0)].0, Subtensor{::, ::, ::int64, ::int64}.0)
Toposort index: 51
Inputs types: [TensorType(float32, 4D), TensorType(float32, 4D)]
Inputs shapes: [(1, 1, 96, 1360), (3, 3, 32, 1)]
Inputs strides: [(384, 384, 4, 384), (4, 12, -36, -4)]
Inputs values: ['not shown', 'not shown']
Outputs clients: [[InplaceDimShuffle{0,2,3,1}(CorrMM{half, (1, 1), (1, 1)}.0)]]
Backtrace when the node is created(use Theano flag traceback.limit=N to make it longer):
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 572, in __call__
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 635, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 166, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 386, in call
return self.model.call(x, mask)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2247, in call
output_tensors, output_masks, output_shapes = self.run_internal_graph(inputs, masks)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2390, in run_internal_graph
computed_mask))
File "/usr/local/lib/python2.7/dist-packages/keras/layers/convolutional.py", line 475, in call
filter_shape=self.W_shape)
File "/usr/local/lib/python2.7/dist-packages/keras/backend/theano_backend.py", line 1520, in conv2d
filter_shape=filter_shape)
HINT: Use the Theano flag 'exception_verbosity=high' for a debugprint and storage map footprint of this apply node.
This appears to be some sort of problem that occurs due to a mismatch in the dimensions. Have you faced this before? It'd be awesome if you could advise me about how I should go about trying to get this to work!
Here is some info about the environment:
docker ubuntu 16.04 image
python 2.7
keras v1.2.2
theano 0.9.0
libav-tools installed for audio codecs, etc
Hi! I'm currently using the feature_extractor model described in keras2_model to iteratively extract features from some audio files. I have an issue with the Normalization2D class of kapre, in particular with the print at row 118:
if int_axis is not None:
print('int_axis={} passed but is ignored, str_axis is used instead.'.format(int_axis))
I wanted to ask, it is possible to avoid this print in any way? Thank you in advance for your help
Best Regards
Tatiana Irene
I found that the feature extracted from the easy_feature_extraction.py and the feature files in data_feat/ are not same. (Tested with GTZAN dataset)
Playing with a couple of days, I found that the running average / std are initial value.
`In [12]: hf['ConvBNEluDr']['batchnormalization_1_running_mean'][:]
Out[12]:
array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0.], dtype=float32)
In [13]: hf['ConvBNEluDr']['batchnormalization_1_running_std'][:]
Out[13]:
array([ 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1.], dtype=float32)
`
Also for all other weights. Could that be the reason for that?
I know. This is a sort of naive (lame) question, yet, please, would you give some advices?
I would like to use this extractor instead of compact-cnn in https://github.com/keunwoochoi/music-auto_tagging-keras/blob/master/example_tagging.py.
I'm unsure how to proceed.
I found the following code
librosa.load(audio_path, sr=SR, duration=LEN_SRC)
the LEN_SRC=29. second, Is there any problem with this duration?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.