Skuldur / Classical-Piano-Composer

MIT License
602 stars 318 forks source link

Error when training #4

Closed kevaday closed 6 years ago

kevaday commented 6 years ago

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

Skuldur commented 6 years ago

Hi,

Yeah I accidentally broke it... I'm sorry. I'm putting together a new computer and I'll fix it as soon as I can. :)

Sincerely, Sigurđur Skúli

On Sat, 5 May 2018, 14:35 kevaday, notifications@github.com wrote:

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\h5pyinit.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

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Skuldur/Classical-Piano-Composer/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AFj9p7DOZWgpNOzPCxfkh9qO1Ixz_lbDks5tvbiggaJpZM4TzqN- .

kevaday commented 6 years ago

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

kevaday commented 6 years ago

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 :+1:

PenguinProgrammer commented 6 years ago

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!

kevaday commented 6 years ago

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!

kevaday commented 6 years ago

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

Skuldur commented 6 years ago

I have pushed a fix to the bug.

The problem was that I had added some MIDI files that did not contain parts to the midi_songs directory but I never finished rewriting the parser in the master branch. It should work now.

On Sun, May 6, 2018 at 2:46 PM, kevaday notifications@github.com wrote:

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Skuldur/Classical-Piano-Composer/issues/4#issuecomment-386884710, or mute the thread https://github.com/notifications/unsubscribe-auth/AFj9p6PHWN91ODHGa-7r5tg9NyB20HLAks5tvwzMgaJpZM4TzqN- .

kevaday commented 6 years ago

Awesome, I'll try it!

kevaday commented 6 years ago

this should work on windows, right?

Skuldur commented 6 years ago

Yes, I haven't set up Linux yet on my new computer so I tested the fix on Windows. :)

On Sun, May 6, 2018 at 9:22 PM, kevaday notifications@github.com wrote:

this should work on windows, right?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Skuldur/Classical-Piano-Composer/issues/4#issuecomment-386915241, or mute the thread https://github.com/notifications/unsubscribe-auth/AFj9p-ewssJV49NwKjqMeKmNs5ScTm8Oks5tv2mVgaJpZM4TzqN- .

kevaday commented 6 years ago

awesome

kevaday commented 6 years ago

so you updated the repository, right?

Skuldur commented 6 years ago

hahah, sorry I only committed them, I'm pushing the update now.

On Sun, May 6, 2018 at 9:35 PM, kevaday notifications@github.com wrote:

so you updated the repository, right?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Skuldur/Classical-Piano-Composer/issues/4#issuecomment-386917151, or mute the thread https://github.com/notifications/unsubscribe-auth/AFj9p7FzPO6z_TckHUSjSkKBMdd1qOUTks5tv2yngaJpZM4TzqN- .

kevaday commented 6 years ago

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