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

Unable to load model from file. #90

Open
KDcx35 opened this issue Dec 1, 2020 · 2 comments
Open

Unable to load model from file. #90

KDcx35 opened this issue Dec 1, 2020 · 2 comments

Comments

@KDcx35
Copy link

KDcx35 commented Dec 1, 2020

Hi, when i use the python generate.py command, it always said 'Unable to load model from file.', but the provided model is there and the file path is right, so why it can't load?
Also, although it can't load model, but it can generate one or two midi file and then begins to throw error.
The error message is like this:

Writing file out\samples\output_0.mid
Traceback (most recent call last):
File "generate.py", line 153, in
main()
File "generate.py", line 150, in main
write_file('output', generate(models, args.bars, styles))
File "generate.py", line 134, in write_file
midi.write_midifile(fpath, mf)
File "D:\anaconda\anaconda\lib\site-packages\midi-0.2.3-py3.7.egg\midi\fileio.py", line 162, in write_midifile
File "D:\anaconda\anaconda\lib\site-packages\midi-0.2. write_file('output', generate(models, args.bars, sty
les))
File "generate.py", line 134, in write_file
midi.write_midifile(fpath, mf)
File "D:\anaconda\anaconda\lib\site-packages\midi-0.2.
3-py3.7.egg\midi\fileio.py", line 162, in write_midifile
File "D:\anaconda\anaconda\lib\site-packages\midi-0.2.
3-py3.7.egg\midi\fileio.py", line 110, in write
File "D:\anaconda\anaconda\lib\site-packages\midi-0.2.
3-py3.7.egg\midi\fileio.py", line 124, in write_track
File "D:\anaconda\anaconda\lib\site-packages\midi-0.2.
3-py3.7.egg\midi\fileio.py", line 152, in encode_midi_ev
ent
ValueError: byte must be in range(0, 256)

Other people have the same error, but seems no one knows how to solves this.
so my question is:
1.how can i load model correctly?
2.if i haven't load the model, then why it can generate some midi results?How does it being generated?
3.how can i fix this ValueError?
Thank you!

@0piero
Copy link

0piero commented Oct 12, 2021

same problem

@jacobhilliker
Copy link

The program is looking for the file at "out/model.h5" (see bottom of constants.py), but the pre-trained model is stored at "archives/v1/model.h5." Maybe that's your problem?

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

3 participants