aamini / introtodeeplearning

Lab Materials for MIT 6.S191: Introduction to Deep Learning
MIT License
7.12k stars 3.59k forks source link

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

Open rvh72 opened 3 years ago

rvh72 commented 3 years ago

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?

tspeterkim commented 2 years ago

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.

aamini commented 2 years ago

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)
Raunak-Singh-Inventor commented 2 years ago

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.

RudrakshSugandhi commented 1 year ago

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

Praveen880890 commented 1 year ago

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