toward-controlled-generation-of-text-pytorch icon indicating copy to clipboard operation
toward-controlled-generation-of-text-pytorch copied to clipboard

Not enough memory

Open Crazylove274 opened this issue 7 years ago • 1 comments

The following problem is encountered when running your code:

Traceback (most recent call last):
  File "/home/syrup274/toward-controlled-generation-of-text-pytorch-master/train.py", line 113, in <module>
    train_discriminator(discriminator)
  File "/home/syrup274/toward-controlled-generation-of-text-pytorch-master/train.py", line 107, in train_discriminator
    _, predicted = torch.max(discriminator(input_data).data, 1)
  File "/home/syrup274/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/syrup274/toward-controlled-generation-of-text-pytorch-master/Model/Modules.py", line 164, in forward
    emb_sentence = self.src_word_emb(input_sentence)
  File "/home/syrup274/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/syrup274/.local/lib/python3.5/site-packages/torch/nn/modules/sparse.py", line 94, in forward
    )(input, self.weight)
  File "/home/syrup274/.local/lib/python3.5/site-packages/torch/nn/_functions/thnn/sparse.py", line 53, in forward
    output = torch.index_select(weight, 0, indices.view(-1))
RuntimeError: $ Torch: not enough memory: you tried to allocate 13GB. Buy new RAM! at /b/wheel/pytorch-src/torch/lib/TH/THGeneral.c:270

Crazylove274 avatar Oct 10 '17 04:10 Crazylove274

Hi @Crazylove274 , I would work on making a better interface to adjust the parameters. By far, you could change the CNN filter size and kernel size in Discriminator down to run the code. Thanks for the interests.

GBLin5566 avatar Oct 11 '17 02:10 GBLin5566