Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't find #16

Open
Jean-Heng-Huang opened this issue Aug 15, 2022 · 1 comment
Open

Can't find #16

Jean-Heng-Huang opened this issue Aug 15, 2022 · 1 comment

Comments

@Jean-Heng-Huang
Copy link

Jean-Heng-Huang commented Aug 15, 2022

when I run (!python3 model_run.py -mode=test -code=isgn -path=./test_pieces/bps_27_1/ -comp=Beethoven -tempo=90 -vel='50,90')on colab.
the result is:
=> loading checkpoint 'isgn_best.pth.tar'
device is 0
=> loaded checkpoint 'prime_isgn_best.pth.tar' (epoch 13)
=> loaded checkpoint 'trill_default_best.pth.tar' (epoch 30)
Traceback (most recent call last):
File "model_run.py", line 1089, in
load_file_and_generate_performance(args.testPath)
File "model_run.py", line 354, in load_file_and_generate_performance
vel_pair)
ValueError: not enough values to unpack (expected 6, got 5)

Please tell me how to solve the problem. Thanks!!!!!

@kaisubr
Copy link

kaisubr commented Aug 20, 2022

I don't know if this was fixed on another branch but it's because of this commit I think. Either revert or making these changes to model_run.py helped me:

def load_file_and_generate_performance(...):
-    test_x, xml_notes, xml_doc, edges, note_locations, part_names = xml_matching.read_xml_to_array(path_name, MEANS, STDS,
+    test_x, xml_notes, xml_doc, edges, note_locations = xml_matching.read_xml_to_array(path_name, MEANS, STDS,
                                                                                        start_tempo, composer,
                                                                                        vel_pair)

...

-    xml_matching.save_midi_notes_as_piano_midi(output_midi, midi_pedals, save_name + '.mid', part_names=part_names,
+    xml_matching.save_midi_notes_as_piano_midi(output_midi, midi_pedals, save_name + '.mid',
                                                bool_pedal=args.boolPedal, disklavier=args.disklavier)

Seems pyScoreParser/xml_matching is outdated or something? don't have a lot of context

P.S. you'll also want to make sure test_result/ exists, either mkdir -p test_result or

def load_file_and_generate_performance(...):
...
    piece_name = path_name.split('/')
+   os.makedirs('test_result/', exist_ok=True)
    save_name = 'test_result/' + piece_name[-2] + '_by_' + args.modelCode + '_z' + str(z)
    perf_worm.plot_performance_worm(output_features, save_name + '.png')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants