introtodeeplearning icon indicating copy to clipboard operation
introtodeeplearning copied to clipboard

Part2_Music_Generation: mdl.lab1.extract_song_snippet(generated_text) outputs "Found 0 songs in text"

Open rvh72 opened this issue 3 years ago • 5 comments

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)

generated_txt.txt

Any idea what is going wrong?

rvh72 avatar Jun 11 '21 19:06 rvh72

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.

tspeterkim avatar Aug 10 '21 13:08 tspeterkim

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:

  1. You need to train the network longer to fit the songs better
  2. You need to regenerate a new sample song since there is some randomness in the sampling (as @peterkim95 indicated above)

aamini avatar Aug 10 '21 22:08 aamini

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.

Raunak-Singh-Inventor avatar Mar 26 '22 16:03 Raunak-Singh-Inventor

@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.

RudrakshSugandhi avatar Nov 26 '22 23:11 RudrakshSugandhi

try a different start string like "AVCV" or something longer instead of just "X" when generating the song

Praveen880890 avatar Feb 02 '23 18:02 Praveen880890