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

cannot allocate memory #4387

Closed
luhc15 opened this issue Dec 28, 2017 · 3 comments
Closed

cannot allocate memory #4387

luhc15 opened this issue Dec 28, 2017 · 3 comments

Comments

@luhc15
Copy link

luhc15 commented Dec 28, 2017

the problem arise when run after 1epoch, but works well in first train epoch as well as the followed 1st validate epoch. batch_size is 8 and work_number is 2。why this happened ?
File "/home/luhongchao/anaconda2/lib/python2.7/site-packages/torch/utils/data/dataload
er.py", line 301, in iter
return DataLoaderIter(self)
File "/home/luhongchao/anaconda2/lib/python2.7/site-packages/torch/utils/data/dataload
er.py", line 158, in init
w.start()
File "/home/luhongchao/anaconda2/lib/python2.7/multiprocessing/process.py", line 130,
in start
self._popen = Popen(self)
File "/home/luhongchao/anaconda2/lib/python2.7/multiprocessing/forking.py", line 121,
in init
self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory

@zou3519
Copy link
Contributor

zou3519 commented Dec 28, 2017

It sounds like you don't have enough RAM in your machine.

@apaszke apaszke closed this as completed Dec 28, 2017
@Lmy0217
Copy link

Lmy0217 commented May 25, 2018

@luhc15 @zou3519 Do you have enough swap space? I got this error, then I created swap(reference this) and fixed it.

@glenn-jocher
Copy link

Recommend this. Setting swap space equal to RAM space and swappiness=0 worked for me.
https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04

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

5 participants