jisungk / deepjazz Goto Github PK
View Code? Open in Web Editor NEWDeep learning driven jazz generation using Keras & Theano!
Home Page: http://deepjazz.io
License: Apache License 2.0
Deep learning driven jazz generation using Keras & Theano!
Home Page: http://deepjazz.io
License: Apache License 2.0
Traceback (most recent call last):
File "generator.py", line 193, in
main(sys.argv)
File "generator.py", line 188, in main
generate(data_fn, out_fn, N_epochs)
File "generator.py", line 107, in generate
chords, abstract_grammars = get_musical_data(data_fn)
File "/media/aram/Mordigan/How-to-Generate-Music-Demo-master/preprocess.py", line 130, in get_musical_data
measures, chords = __parse_midi(data_fn)
File "/media/aram/Mordigan/How-to-Generate-Music-Demo-master/preprocess.py", line 25, in __parse_midi
melody1, melody2 = melody_stream.getElementsByClass(stream.Voice)
ValueError: need more than 0 values to unpack
and what do I do now?
def __sample(a, temperature=1.0):
a = np.log(a) / temperature
a = np.exp(a) / np.sum(np.exp(a))
return np.argmax(np.random.multinomial(1, a, 1))
It shows up multinomial has an error
np.argmax(np.random.multinomial(1, a, 1))
File "mtrand.pyx", line 4593, in mtrand.RandomState.multinomial (numpy\random\mtrand\mtrand.c:37541)
ValueError: sum(pvals[:-1]) > 1.0
I'm trying this great work to generate music from other midi files but there is some kinda "magic" parts in the preprocess.py file for me.
some code parts use magic numbers like
melody_stream = midi_data[5]
partIndices = [..]
other require strong knowledge of the example midi file & music21 library.
I manage to achieve the __parse_midi function to return values without exception but got an error later in __get_abstract_grammars (return empty list)
after change I changed 4 more thing and finally the training started but got a value error in __generate_grammar after a few iterations.
Basically I would like to make the generator to work with a preprocessed midi file with single channel .
I use python3.5, but when I run generator.py , it appears ''cannot import name 'izip_longest' ''. What's wrong with it? I have installed all the required packages.
music21.exceptions21.StreamException: attempting to access index 0 while elements is of size 0
Try to run the script but failed. Any pointer?
Using Theano backend.
Traceback (most recent call last):
File "generator.py", line 193, in <module>
main(sys.argv)
File "generator.py", line 188, in main
generate(data_fn, out_fn, N_epochs)
File "generator.py", line 107, in generate
chords, abstract_grammars = get_musical_data(data_fn)
File "/Users/grant/project/deepjazz/preprocess.py", line 130, in get_musical_data
measures, chords = __parse_midi(data_fn)
File "/Users/grant/project/deepjazz/preprocess.py", line 37, in __parse_midi
melody_voice.insert(0, key.KeySignature(sharps=1, mode='major'))
TypeError: __init__() got an unexpected keyword argument 'mode'
Traceback (most recent call last):
File "generator.py", line 200, in
main(sys.argv)
File "generator.py", line 195, in main
generate(data_fn, out_fn, N_epochs)
File "generator.py", line 141, in generate
diversity=diversity)
File "generator.py", line 93, in __generate_grammar
length = float(next_val.split(',')[1])
ValueError: could not convert string to float:
What was the original version # of the keras and theanos used?
At the the top of README it says "Note: deepjazz has been succeeded by songbird.ai and is no longer being actively developed." But songbird.ai is not loading.
Is there a new website? Or is https://deepjazz.io/ the latest website? If so please update README. Thx.
I tried to train the model with other music, but it failed. I think the problems come from this two lines:
melody_stream = midi_data[5] # For Metheny piece, Melody is Part #5.
melody1, melody2 = melody_stream.getElementsByClass(stream.Voice)
-need to double check refactored code with prior code
-some qualitative differences in generated music
Hi,
I train your model on one midi file and I split data into test and valid. Next I plot test/valid and I see that model is overfit. Did you known how to prevent this?
# build a 2 stacked LSTM
model = Sequential()
model.add(LSTM(128, return_sequences=True, input_shape=(max_len, N_values)))
model.add(Dropout(0.2))
model.add(LSTM(128, return_sequences=False))
model.add(Dropout(0.2))
model.add(Dense(N_values))
model.add(Activation('softmax'))
model.compile(loss='categorical_crossentropy', optimizer='rmsprop', metrics=['accuracy'])
history = model.fit(X, y, batch_size=128, nb_epoch=N_epochs, validation_split=0.22)
print(history.history.keys())
# acc history
plt.plot(history.history['acc'])
plt.plot(history.history['val_acc'])
plt.title('model accuracy')
plt.ylabel('accuracy')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.savefig("acc_history.png")
plt.close()
plt.plot(history.history['loss'])
plt.plot(history.history['val_loss'])
plt.title('model loss')
plt.ylabel('loss')
plt.xlabel('epoch')
plt.legend(['train', 'test'], loc='upper left')
plt.savefig("history_loss.png")
return history
I've been trying to run this program but I've run into an error. On line 24 of preprocess.py (
Line 24 in b0aa6ca
This is closed issue, but I could not solve this error.
How can I handle this??
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.