enriqueav / lstm_lyrics Goto Github PK
View Code? Open in Web Editor NEWLSTM text generation by word. Used to generate lyrics from a corpus of a music genre.
License: MIT License
LSTM text generation by word. Used to generate lyrics from a corpus of a music genre.
License: MIT License
I get this error when using generate.py.
File "generate.py", line 133, in
model, indices_word, word_indices, seed, sequence_length, diversity, quantity
File "generate.py", line 68, in generate_text
next_index = sample(preds, diversity)
File "generate.py", line 35, in sample
preds = np.log(preds) / temperature
TypeError: unsupported operand type(s) for /: 'float' and 'NoneType'
I have created the script to generate from seed generate.py
but I need to update the Medium page with this information.
Following the examples in the readme but using my own input set results in the script just..ending after 24 completed epochs. No output or errors.
Epoch 24/100
123/123 [==============================] - 4s 35ms/step - loss: 0.0356 - acc: 0.9992 - val_loss: 7.1317 - val_acc: 0.1250
root@tf2-6d4dd96d7b-klz2t:/notebooks/
The first time I ran the script I had encoding issues, now it's just ending.
Update medium history with the changes to
I am trying to use the generator method to load data in batches. When I try to do so, the following line returns the error:
y[i] = word_indices[targets[index % len(inputs)]]
This happens for both the embedding lysrics lstm and non embedding lyrics lstm for me. Any way to fix the issue?
is the any way to run this on a GPU?
Hi , first of all thank you uploading the model. just have a doubt .
one example like
suppose training data : he has fever since last week .
when we will seed like below
input : fever
out put : Fever since last week.
will this model works?
Remove the parameter SIMPLE_MODEL and the possibility of a two layer LSTM model.
I have run some tests, and it only increases the training time, without a real improvement in accuracy.
Also, in only complicates the explanation.
The way to pick the seed is a little complicated.
We can, instead, choose a seed from sentences+sentences_test.
I am trying to generate lyrics based on the model learned after n epochs using
python generate.py -v reggeaton_vocabulary.txt -n checkpoints/LSTM_LYRICS-epoch003-words12952-sequence10-minfreq10-loss4.0160-acc0.3391-val_loss3.8874-val_acc0.3559 -s "duro dale papichulo" -q 60 -d 0.7
However, I am getting the following error
File "./lstm_lyrics/env/lib/python3.6/site-packages/keras/engine/training_utils.py", line 128, in standardize_input_data
'with shape ' + str(data_shape))
ValueError: Error when checking input: expected embedding_1_input to have 2 dimensions, but got array with shape (1, 10, 12952)
I am running the code on macOS 10.13.6
Python libraries:
absl-py==0.7.0
astor==0.7.1
entrypoints==0.3
flake8==3.7.7
gast==0.2.2
grpcio==1.19.0
h5py==2.9.0
Keras==2.2.4
Keras-Applications==1.0.7
Keras-Preprocessing==1.0.9
Markdown==3.0.1
mccabe==0.6.1
mock==2.0.0
numpy==1.16.2
pbr==5.1.3
protobuf==3.7.0
pycodestyle==2.5.0
pyflakes==2.1.1
PyYAML==3.13
scipy==1.2.1
six==1.12.0
tensorboard==1.13.0
tensorflow==1.13.1
tensorflow-estimator==1.13.0
termcolor==1.1.0
Werkzeug==0.14.1
Thank you
Training RNN is very slow. Add already trained weights to allow people to start generating lyrics right after cloning.
The function to shuffle and split set can be simplified a little bit.
But the generate.py require vocabulary.txt as input, is this intentionaly set like this?
Move the validation of each epoch to fit_generator instead of on_epoch_end.
This can be done using validation_data and validation_steps arguments of model.fit_generator.
Maybe you can add h5py to requirements.
File "/usr/local/lib/python3.7/site-packages/keras/engine/training_utils.py", line 145, in standardize_input_data
str(data_shape))
ValueError: Error when checking input: expected bidirectional_1_input to have shape (10, 6606) but got array with shape (10, 12952)
ALREADY TRAINED AND CREATED CHECKPOINTS
I GET THIS ERROR WHEN TRYING TO GENERATE LYRICS FROM CHECKPOINTS
ALL REQUIREMENTS AND VERSIONS MATCH
I have only added the script to start the training. I need to create a script to generate the text from a random(?) seed.
"perrea mami perrea dale duro perrea mami perrea dale duro
perrea mami perrea dale duro perrea mami perrea dale duro
Traceback (most recent call last):
File "generate.py", line 133, in
model, indices_word, word_indices, seed, sequence_length, diversity, quantity
File "generate.py", line 67, in generate_text
preds = model.predict(x_pred, verbose=0)[0]
File "/usr/local/lib/python3.7/site-packages/keras/engine/training.py", line 1441, in predict
x, _, _ = self._standardize_user_data(x)
File "/usr/local/lib/python3.7/site-packages/keras/engine/training.py", line 579, in _standardize_user_data
exception_prefix='input')
File "/usr/local/lib/python3.7/site-packages/keras/engine/training_utils.py", line 145, in standardize_input_data
str(data_shape))
ValueError: Error when checking input: expected bidirectional_1_input to have shape (10, 6606) but got array with shape (10, 12952)
haradhruchitrajitgogoi@Haradhruchitrajits-MacBook-Pro lstm_lyrics %
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.