jaron / deep-listening Goto Github PK
View Code? Open in Web Editor NEWDeep Learning experiments for audio classification
Deep Learning experiments for audio classification
Hi,
I am trying to the 3-us8k-cnn-extract-train, but at the section "Saving Extracted Features (optional)", I got this results:
Saving fold1
Features of fold1 = (0, 60, 41, 2)
Labels of fold1 = (0, 0)
Saved data/us8k-np-cnn/fold1_x.npy
Saved data/us8k-np-cnn/fold1_y.npy
Saving fold2
Features of fold2 = (0, 60, 41, 2)
Labels of fold2 = (0, 0)
Saved data/us8k-np-cnn/fold2_x.npy
Saved data/us8k-np-cnn/fold2_y.npy
Saving fold3
Features of fold3 = (0, 60, 41, 2)
Labels of fold3 = (0, 0)
Saved data/us8k-np-cnn/fold3_x.npy
Saved data/us8k-np-cnn/fold3_y.npy
Saving fold4
Features of fold4 = (0, 60, 41, 2)
Labels of fold4 = (0, 0)
Saved data/us8k-np-cnn/fold4_x.npy
Saved data/us8k-np-cnn/fold4_y.npy
Saving fold5
Features of fold5 = (0, 60, 41, 2)
Labels of fold5 = (0, 0)
Saved data/us8k-np-cnn/fold5_x.npy
Saved data/us8k-np-cnn/fold5_y.npy
Saving fold6
Features of fold6 = (0, 60, 41, 2)
Labels of fold6 = (0, 0)
Saved data/us8k-np-cnn/fold6_x.npy
Saved data/us8k-np-cnn/fold6_y.npy
Saving fold7
Features of fold7 = (0, 60, 41, 2)
Labels of fold7 = (0, 0)
Saved data/us8k-np-cnn/fold7_x.npy
Saved data/us8k-np-cnn/fold7_y.npy
Saving fold8
Features of fold8 = (0, 60, 41, 2)
Labels of fold8 = (0, 0)
Saved data/us8k-np-cnn/fold8_x.npy
Saved data/us8k-np-cnn/fold8_y.npy
Saving fold9
Features of fold9 = (0, 60, 41, 2)
Labels of fold9 = (0, 0)
Saved data/us8k-np-cnn/fold9_x.npy
Saved data/us8k-np-cnn/fold9_y.npy
Saving fold10
Features of fold10 = (0, 60, 41, 2)
Labels of fold10 = (0, 0)
Saved data/us8k-np-cnn/fold10_x.npy
Saved data/us8k-np-cnn/fold10_y.npy
I think it's a problem causing a later error on "Training on a minimised data set" section.
IOError Traceback (most recent call last)
in ()
2
3 # load fold1 for testing
----> 4 train_x, train_y = load_folds([1])
5
6 # load fold2 for validation
in load_folds(folds)
42 feature_file = os.path.join(data_dir, fold_name + '_x.npy')
43 labels_file = os.path.join(data_dir, fold_name + '_y.npy')
---> 44 loaded_features = np.load(feature_file)
45 loaded_labels = np.load(labels_file)
46 print fold_name, "features: ", loaded_features.shape
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/lib/npyio.pyc in load(file, mmap_mode, allow_pickle, fix_imports, encoding)
427 except:
428 raise IOError(
--> 429 "Failed to interpret file %s as a pickle" % repr(file))
430 finally:
431 if own_fid:
IOError: Failed to interpret file 'data/us8k-np-cnn-mini/fold1_x.npy' as a pickle
Many thanks for the helps!
Hi Jaron,
I am trying to run the 4-us8k-cnn-salamon.ipynb notebook, however
in the section "Training on the full data set (intensive)"
I get the following error
model.fit(train_x, train_y, validation_data=(valid_x, valid_y), callbacks=[earlystop], batch_size=24, nb_epoch=2)
"TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'"
Many thanks for the contribution!
Hi,
i am trying 3-us8k-cnn-extract-train but met with error at the section "Training on a minimised data set". hope you will help me to get out of this
this is what i got
ValueError Traceback (most recent call last)
in ()
18 # now fit the model to the training data, evaluating loss against the validation data
19 print("Training model...")
---> 20 model.fit(train_x, train_y, validation_data=(valid_x, valid_y), callbacks=[earlystop], batch_size=20, epochs=3)
21
22 # now evaluate the trained model against the unseen test data
~\Anaconda3\lib\site-packages\keras\models.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
1000 initial_epoch=initial_epoch,
1001 steps_per_epoch=steps_per_epoch,
-> 1002 validation_steps=validation_steps)
1003
1004 def evaluate(self, x=None, y=None,
~\Anaconda3\lib\site-packages\keras\engine\training.py in fit(self, x, y, batch_size, epochs, verbose, callbacks, validation_split, validation_data, shuffle, class_weight, sample_weight, initial_epoch, steps_per_epoch, validation_steps, **kwargs)
1628 sample_weight=sample_weight,
1629 class_weight=class_weight,
-> 1630 batch_size=batch_size)
1631 # Prepare validation data.
1632 do_validation = False
~\Anaconda3\lib\site-packages\keras\engine\training.py in _standardize_user_data(self, x, y, sample_weight, class_weight, check_array_lengths, batch_size)
1478 output_shapes,
1479 check_batch_axis=False,
-> 1480 exception_prefix='target')
1481 sample_weights = _standardize_sample_weights(sample_weight,
1482 self._feed_output_names)
~\Anaconda3\lib\site-packages\keras\engine\training.py in _standardize_input_data(data, names, shapes, check_batch_axis, exception_prefix)
121 ': expected ' + names[i] + ' to have shape ' +
122 str(shape) + ' but got array with shape ' +
--> 123 str(data_shape))
124 return data
125
ValueError: Error when checking target: expected activation_4 to have shape (10,) but got array with shape (0,)
and it is craeting problem in later sections
@jaron Can you please explain how number of frames in each window is set in 3-us8k-cnn-extract-train.ipynb script. To be exact, I am referring to extract_features method. I understand that the script is creating overlapping windows from windows method, but I don't understand how librosa library is able to adjust frames with librosa.feature.melspectrogram function (script doesn't explicitly set number of frames in a window). I tried looking at librosa documentation, but no luck in getting the answer.
Thanks
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.