GithubHelp home page GithubHelp logo

enriqueav / lstm_lyrics Goto Github PK

View Code? Open in Web Editor NEW
81.0 81.0 26.0 5.28 MB

LSTM text generation by word. Used to generate lyrics from a corpus of a music genre.

Home Page: https://medium.com/@enriqueav/word-level-lstm-text-generator-creating-automatic-song-lyrics-with-neural-networks-b8a1617104fb

License: MIT License

Python 100.00%

lstm_lyrics's People

Contributors

enriqueav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lstm_lyrics's Issues

generate.py - unsupported operand

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'

lstm_train_embedded stops after X epochs

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

Update medium history with the changes to

  1. Add enter as a word
  2. Include validation data in fit
  3. Simplify split
  4. Simplify indexing in generator
    etc.

Unhashable type: 'list' in generator method

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?

concern

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 two layer model

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.

Expected embedding_1_input to have 2 dimensions, but got array with shape (1, 10, 12952)

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

Upload trained weights

Training RNN is very slow. Add already trained weights to allow people to start generating lyrics right after cloning.

I keep getting this error , please help

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

Create script to generate text

I have only added the script to start the training. I need to create a script to generate the text from a random(?) seed.

I keep getting this error when trying to generate lyrics

"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 %

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.