minimaxir / textgenrnn

Easily train your own text-generating neural network of any size and complexity on any text dataset with a few lines of code.
Other
4.94k stars 754 forks source link

First time to try but failed #146

Open ShaoxunZeng opened 5 years ago

ShaoxunZeng commented 5 years ago

I just install the textgenrnn by conda https://anaconda.org/RMG/textgenrnn and I follow the document

from textgenrnn import textgenrnn

textgen = textgenrnn()
textgen.generate()

And it gives me an error OSError: Unable to open file (unable to open file: name ='/Users/xxx/anaconda3/envs/ML/lib/python3.7/site-packages/textgenrnn/textgenrnn_weights.hdf5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0) I don't know how to do. Many thanks to you who could solve my problem!!!

MITEL-UNIUD commented 5 years ago

I have the same issue. Apparently conda does not install the weights. Take them from github, put them in your dir, call this way:

textgen = textgenrnn(weights_path='textgenrnn_weights.hdf5',config_path='textgenrnn_config.json',vocab_path='textgenrnn_vocab.json')

The main issue for me is that they seem to be needed also when training a new model.