Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MemoryError #1

Open
GabrielLin opened this issue May 30, 2016 · 3 comments
Open

MemoryError #1

GabrielLin opened this issue May 30, 2016 · 3 comments

Comments

@GabrielLin
Copy link

C:\Anaconda2\python.exe F:/MyProject_20151101/ChinesePoemRNN/src/model.py
Using Theano backend.
Traceback (most recent call last):
File "F:/MyProject_20151101/ChinesePoemRNN/src/model.py", line 125, in
label = to_categorical([i - 1 for i in label])
File "c:\python_dev\keras-1.0.3\keras\utils\np_utils.py", line 14, in to_categorical
Y = np.zeros((len(y), nb_classes))
MemoryError

@hx364
Copy link
Owner

hx364 commented Jun 3, 2016

I think the reason is your ram is not enough, I used a desktop with 32g ram, and it works fine. I think there are 2 ways: 1) change to another computer 2) modify the code to stream read the data.

@clovercoser
Copy link

There are too many unique characters(6000+) in qun_tang_shi.txt. I delete it to 4000+, then it works for me.

@clovercoser
Copy link

@hx364 By the way, there are some errors in your repository because of carelessness.

  1. Missing 'return model' in the definition of function train_model
  2. Forget to define 'char_to_index' and 'index_to_char' as global names, which will be used in function 'make_poem_index'. Define them outside the main function or pass it to function 'make_poem_index' as a parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants