sumuzhao / CycleGAN-Music-Style-Transfer

Symbolic Music Genre Transfer with CycleGAN
MIT License
261 stars 66 forks source link

ValueError on some training runs: no beat timings present/learned #19

Open Yannik1337 opened 3 years ago

Yannik1337 commented 3 years ago

When training your model, you offer the opportunity to save some generated samples every k steps. On some runs, I have a problem with visualizing several samples, mostly the cyclic mapping back to the origin domain. However, this is not present in every run, but mostly in runs with a large number of epochs (50 or so).

A traceback while trying to visualize a sample (in another script) is shown here:

Traceback (most recent call last):
  File "<ipython-input-56-c8394e1b4f1b>", line 7, in visualize_dir
    multitrack = pypianoroll.read(directory+"/"+name)
  File "/usr/local/lib/python3.6/dist-packages/pypianoroll/inputs.py", line 336, in read
    return from_pretty_midi(PrettyMIDI(str(path)), **kwargs)
  File "/usr/local/lib/python3.6/dist-packages/pypianoroll/inputs.py", line 186, in from_pretty_midi
    raise ValueError("Cannot get beat timings to quantize the piano roll.")
ValueError: Cannot get beat timings to quantize the piano roll.

Opening these files with MuseScore only shows a blank page.

If you or any other user has experienced the same or a similar problem, please share them here. I am open to any suggestions and can image working on a fix together. Ideally, if somebody already has a solution, or knows why this happens, leave a comment.

Thanks in advance.

dedededefo commented 1 year ago

Hello, Have you solved this problem?I think the convert_clean.py used in the second step of data preprocessing There is a problem with the converter function in it. It cannot implement the function when installing the package pypianoroll 0.1.3.