yoavz / music_rnn

Music Language Modeling with Recurrent Neural Networks
http://yoavz.com/music_rnn
197 stars 38 forks source link

import own midi #7

Open Eumi opened 7 years ago

Eumi commented 7 years ago

i get this error when i try to run it with my own midi =,O

Parsing train... Parsing test... Parsing valid... {'A': 344, 'B': 184, 'C': 712, 'D': 176, 'E': 360, 'F': 368, 'G': 712} Number of chords: 7 Max Sequence length: 480 Avg Sequence length: 480.0 Num Sequences: 6 Combining train Traceback (most recent call last): File "/home/eumi/AI_Composer-master/main.py", line 10, in nottingham_util.create_model() File "/home/eumi/AI_Composer-master/nottingham_util.py", line 509, in create_model prepare_nottingham_pickle(time_step, verbose=True) File "/home/eumi/AI_Composer-master/nottingham_util.py", line 125, in prepare_nottingham_pickle store[d] = [ combine(m, h) for m, h in data[d] ] File "/home/eumi/AI_Composer-master/nottingham_util.py", line 113, in combine for h in harmony ] KeyError: 'NONE'

=/ i tried a lot and i don't get it to work with my own midi files

BeyondCloud commented 6 years ago

In nottingham_util.py line 84 change chords = { c: i for c, i in chords.iteritems() if chords[c] >= chord_cutoff} to chords = { c: i for c, i in chords.iteritems() if chords[c] >= chord_cutoff or c == 'NONE'} may solve the problem