magenta/magenta
在 GitHub 查看Is it expected for --primer_midi to fail with polyphonic file?
Open
#296 创建于 2016年10月25日
help wanted
描述
Hi, I am experiencing an error when I try to run melody_rnn_generate and passing a polyphonic midi file to --primer_midi:
Traceback (most recent call last):
File "/home/brannondorsey/miniconda2/envs/magenta/bin/melody_rnn_generate", line 11, in <module>
sys.exit(console_entry_point())
File "/home/brannondorsey/miniconda2/envs/magenta/lib/python2.7/site-packages/magenta/models/melody_rnn/melody_rnn_generate.py", line 235, in console_entry_point
tf.app.run(main)
File "/home/brannondorsey/miniconda2/envs/magenta/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "/home/brannondorsey/miniconda2/envs/magenta/lib/python2.7/site-packages/magenta/models/melody_rnn/melody_rnn_generate.py", line 231, in main
run_with_flags(generator)
File "/home/brannondorsey/miniconda2/envs/magenta/lib/python2.7/site-packages/magenta/models/melody_rnn/melody_rnn_generate.py", line 208, in run_with_flags
generated_sequence = generator.generate(input_sequence, generator_options)
File "/home/brannondorsey/miniconda2/envs/magenta/lib/python2.7/site-packages/magenta/music/sequence_generator.py", line 226, in generate
return self._generate(input_sequence, generator_options)
File "/home/brannondorsey/miniconda2/envs/magenta/lib/python2.7/site-packages/magenta/models/melody_rnn/melody_rnn_sequence_generator.py", line 126, in _generate
assert len(extracted_melodies) <= 1
AssertionError
Can anyone confirm if this is indeed because the file has more than one instrument and therefore melody and so melody_rnn_generate simply refuses to process the file? If this is in fact the case a friendly error message might be helpful to new users. Or at least some documentation in the --primer_midi flag description that specifies that the file must be monophonic. I am happy to take a stab at adding this but I wanted to make sure that this is indeed the case before doing so.
More about magenta + polyphonic here.
Cheers, Brannon