introtodeeplearning
introtodeeplearning copied to clipboard
Part2_Music_Generation: mdl.lab1.extract_song_snippet(generated_text) outputs "Found 0 songs in text"
In Part2_Music_Generation.ipynb, I get an unexpected output from the API to generate music from predicted notes. This is what I see:
generated_songs = mdl.lab1.extract_song_snippet(generated_text)
print(generated_songs)
Found 0 songs in text
[]
The solutions notebook has the same behavior. The value of is valid, see uploaded txt file:
print(generated_text)
Any idea what is going wrong?
Just try regenerating the generated_text
a couple times.
There is some element of chance as the generated text might not be a valid song in text or syntax.
The generated text file you shared is not a valid song so the error message you are seeing is correct. There are several reasons for this:
- You need to train the network longer to fit the songs better
- You need to regenerate a new sample song since there is some randomness in the sampling (as @peterkim95 indicated above)
I found that the songs are only generated if you are on Google Colab. When working on local jupyterlab, it isn't able to generate the song even if it is valid.
@aamini said to try to increase the num_iteration from 2000 to 4000 or more
num_training_iterations = 4000
Then it will generate the songs.
try a different start string like "AVCV" or something longer instead of just "X" when generating the song