robbiebarrat / rapping-neural-network

Rap song writing recurrent neural network trained on Kanye West's entire discography
1.04k stars 167 forks source link

Cannot generate new lyrics #20

Closed littlevoices closed 6 years ago

littlevoices commented 6 years ago

I'd love to test the program but unfortunately I'm getting errors when I try to generate a new lyrics even with the default settings (as in without training it with new lyrics).

File "model.py", line 300, in <module> main(depth, train_mode) File "model.py", line 277, in main model = create_network(depth) File "model.py", line 29, in create_network model.load_weights(str(artist + ".rap")) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2701, in load_weights import h5py

I have tested it on a virtual environment and native, on a mac and on a linux (Ubuntu) but I'm getting the same error. I'm using: Python 2.7 Tensorflow 1.4.1 Keras 1.2.2 numpy 1.12.1

Any idea of what could be the cause of that?

robbiebarrat commented 6 years ago

looks like you don't have h5py installed - sudo pip install h5py

littlevoices commented 6 years ago

That solved part of the issue, thanks However now I run into this problem: `========= Total params: 2,248 Trainable params: 2,248 Non-trainable params: 0


Traceback (most recent call last): File "model.py", line 300, in main(depth, train_mode) File "model.py", line 277, in main model = create_network(depth) File "model.py", line 29, in create_network model.load_weights(str(artist + ".rap")) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2708, in load_weights self.load_weights_from_hdf5_group(f) File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 2781, in load_weights_from_hdf5_group ' elements.') ValueError: Layer #0 (named "lstm_1" in the current model) was found to correspond to layer lstm_1 in the save file. However the new layer lstm_1 expects 12 weights, but the saved weights have 3 elements.

littlevoices commented 6 years ago

I fixed the problem by upgrading to Keras 2.0.2 Thanks Robbie, I love what you have done :)

robbiebarrat commented 6 years ago

glad you got it fixed, and glad that you liked it!