Skuldur / Classical-Piano-Composer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when training

kevaday opened this issue · comments

Whenever I run the training script, even using the original training data, I get the following error:
TypeError: expected 0 arguments, got 1
Here is the full output:
Warning (from warnings module):
File "E:\Python\3.6.2\lib\site-packages\h5py_init_.py", line 36
from .conv import register_converters as register_converters
FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
Using TensorFlow backend.
Traceback (most recent call last):
File "E:\Python\Projects\Classical-Piano-Composer-master\lstm.py", line 121, in
train_network()
File "E:\Python\Projects\Classical-Piano-Composer-master\lstm.py", line 17, in train_network
notes = get_notes()
File "E:\Python\Projects\Classical-Piano-Composer-master\lstm.py", line 37, in get_notes
parts = instrument.partitionByInstrument(midi)
File "E:\Python\3.6.2\lib\site-packages\music21\instrument.py", line 1842, in partitionByInstrument
p.insert(subStream.elementOffset(e), e)
File "E:\Python\3.6.2\lib\site-packages\music21\stream_init
.py", line 1701, in insert
self.coreGuardBeforeAddElement(element)
File "E:\Python\3.6.2\lib\site-packages\music21\stream\core.py", line 313, in coreGuardBeforeAddElement
(element, id(element), self, id(self)))
File "E:\Python\3.6.2\lib\site-packages\music21\stream_init
.py", line 245, in repr
return super().repr(self)
TypeError: expected 0 arguments, got 1

If anyone could help, I would very much appreciate it,
Thanks

Ok cool! thanks. By the way the this error that I was getting was on Windows. I also tried it on ubuntu and it just crashed. Now I tried it on Kali Linux (which is essentially debian) and it worked!
The music generation was working on Windows but the training wasn't.
Also, I really like your program, it's very cool!
Thanks for the response,
kev

actually I thought that the training was working on debian (kali linux) but I still got the original result sadly. I hope you can fix this 👍

This issue, and potentially a follow up issue can be worked around. I just ran this on windows 10 64 bit.

The error you see is a warning which can be circumvented by the following command
"pip install h5py==2.8.0rc1" (I think a 0, but possibly an upper case O)
The warning is slated to be fixed when the next version of h5py comes out.

The second error you'll run into is if you try to open the wrong file name in predict.py.
This can be fixed by writing "weights.hdf5" in line 71. Although if you rename the weight files, you'll have to change it to match.

This program is really cool, thanks for sharing it!

Cool! thanks Penguin. Yea I know about the weights file, I just added a variable at the top so that it can easily be changed.
Thanks for the help man!

So I tried doing what you did but I still got the same error.

Awesome, I'll try it!

this should work on windows, right?

awesome

so you updated the repository, right?

Phew, I got scared there a second because I got the same error lol