ruidan / Unsupervised-Aspect-Extraction

Code for acl2017 paper "An unsupervised neural attention model for aspect extraction"
Apache License 2.0
335 stars 117 forks source link

Memory Error #2

Closed ghost closed 6 years ago

ghost commented 6 years ago

I got this output:

Creating vocab ...
   108060026 total words, 17156 unique words
  keep the top 9000 words
 Reading dataset ...
  train set
   <num> hit rate: 0.61%, <unk> hit rate: 1.35%
  test set
   <num> hit rate: 0.55%, <unk> hit rate: 1.31%
Traceback (most recent call last):
  File "train.py", line 54, in <module>
    train_x = sequence.pad_sequences(train_x, maxlen=overall_maxlen)
  File "/home/italo/.local/lib/python2.7/site-packages/keras/preprocessing/sequence.py", line 61, in pad_sequences
    x = (np.ones((num_samples, maxlen) + sample_shape) * value).astype(dtype)
  File "/home/italo/.local/lib/python2.7/site-packages/numpy/core/numeric.py", line 188, in ones
    a = empty(shape, dtype, order)
MemoryError

What's happening? There's any way to change Python 2.7 memory?

ruidan commented 6 years ago

The program runs out of memory at the sequence padding step. You can refer to issue #1 for this.

ghost commented 6 years ago

Ok, Thanks! I used another computer to run.

ghost commented 6 years ago

But I'm still having problems with the libraries to execute. Wich Tensorflow version did you use?

ruidan commented 6 years ago

Keras 1.2.1, and the backend is theano 0.9.0