Hello,
In assignment “Improvise_a_Jazz_Solo_with_an_LSTM_Network_v4”, the code cell:
X, Y, n_values, indices_values, chords = load_music_utils(‘data/original_metheny.mid’)
has the output shown below. Specifically, n_values is 90:
number of training examples: 60
Tx (length of sequence): 30
total # of unique values: 90
shape of X: (60, 30, 90)
Shape of Y: (30, 60, 90)
Number of chords 19
However, when I run the same assignment in Google Colab, I get a different value i.e. 78 for n_values:
number of training examples: 60
Tx (length of sequence): 30
total # of unique values: 78
shape of X: (60, 30, 78)
Shape of Y: (30, 60, 78)
Number of chords 19
I installed mido v1.2.9 and pydub v0.24.0 in my Colab notebook, to match the versions that are installed in the DLS notebook.
The functions that return the above metadata are load_music_utils(), get_musical_data(), get_corpus_data(), and __get_abstract_grammars(). I was browsing through that code and did not see anything obvious that could account for the discrepancy in total # of unique values.
Can you help me understand what is the reason behind this?
I can run most of my Colab notebook without any issues. The model compile and train code runs as expected.
The problem is the last step that generates new music:
out_stream = generate_music(inference_model, indices_values, chords)
The call to generate_music() throws this error:
ValueError: Input 0 is incompatible with layer model_1: expected shape=(None, 1, 78), found shape=(None, 1, 90)
Can you help me figure this out?