question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ran out of memory

See original GitHub issue

Hey guys,

I’m trying to use fairseq to train a simple summarizer like a translation task. oom happened where even though when I set --max-tokens to 500. 100 or smaller max-tokens set got error:

Traceback (most recent call last):
  File "train.py", line 359, in <module>
    main(args)
  File "train.py", line 78, in main
    trainer.dummy_train_step([dummy_batch])
  File "/home/fairseq/fairseq/trainer.py", line 326, in dummy_train_step
    self.train_step(dummy_batch, dummy_batch=True)
  File "/home/fairseq/fairseq/trainer.py", line 176, in train_step
    self.model, self.criterion, sample,
  File "/home/fairseq/fairseq/tasks/fairseq_task.py", line 157, in get_loss
    return criterion(model, sample)
  File "/home/.local/lib/python3.5/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/fairseq/fairseq/criterions/cross_entropy.py", line 30, in forward
    net_output = model(**sample['net_input'])
TypeError: 'NoneType' object is not subscriptable

So, any suggestion? My dataset contains about 100,000 sentences and my gpu is single 1080ti 11G memory.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
edunovcommented, Oct 23, 2018

Another thing to try is to apply BPE encoding to your data, that will naturally reduce dictionary size. There are examples in our repository: https://github.com/pytorch/fairseq/blob/master/examples/translation/prepare-wmt14en2de.sh#L125-L132

1reaction
huihuifancommented, Oct 23, 2018

1 million is too large. try --thresholdsrc --thresholdtgt

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix: Google Chrome Ran Out Of Memory - Appuals.com
Method 3: Clear Cache · Open Google Chrome · Press CTRL, SHIFT and DELETE keys simultaneously (CTRL + SHIFT + DELETE) · Check...
Read more >
How to Fix Google Chrome's Out of Memory Error
How to Fix Google Chrome's Out of Memory Error · Close Your Unused Tabs in Chrome · Restart Your Chrome Browser · Force...
Read more >
How to Fix Chrome Ran Out of Memory - TechCult
How to Fix Chrome Ran Out of Memory in Windows 10 · 1. Launch Task Manager by hitting Ctrl + Shift + Esc...
Read more >
How to Fix Ran Out of Video RAM or Memory Errors
Press the Windows Key + R and type in SystemPropertiesAdvanced followed by the enter key. You should be in the Advanced tab of...
Read more >
Here are the ways to fix 'Google Chrome Is Out of Memory' error
1. Restart your device. 2. Update Google Chrome. 3. Clear the browser's cache.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found