toward-controlled-generation-of-text-pytorch
toward-controlled-generation-of-text-pytorch copied to clipboard
Not enough memory
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
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.