show-attend-and-tell icon indicating copy to clipboard operation
show-attend-and-tell copied to clipboard

MemoryError when train the model

Open syw2014 opened this issue 7 years ago • 9 comments

MemoryError when train the model, I want to know how large the memory does the model need if I train the model, thx

syw2014 avatar Sep 04 '17 09:09 syw2014

Have you solved this problem?

xx674967 avatar Dec 12 '17 06:12 xx674967

I have got the memory error while trying to train the model. Is there a solution to it ? anyone please ?

nayyeraafaq avatar Mar 11 '18 09:03 nayyeraafaq

Traceback (most recent call last): File "/media/aafaq/Data/PycharmProjects/show-attend-and-tell/train.py", line 25, in

File "/media/aafaq/Data/PycharmProjects/show-attend-and-tell/train.py", line 8, in main word_to_idx = data['word_to_idx'] File "/media/aafaq/Data/PycharmProjects/show-attend-and-tell/core/utils.py", line 13, in load_coco_data data['features'] = hickle.load(os.path.join(data_path, '%s.features.hkl' %split)) File "/usr/local/lib/python2.7/dist-packages/hickle.py", line 624, in load py_container = _load(py_container, h_root_group) File "/usr/local/lib/python2.7/dist-packages/hickle.py", line 749, in _load py_subcontainer = _load(py_subcontainer, h_node) File "/usr/local/lib/python2.7/dist-packages/hickle.py", line 756, in _load subdata = load_dataset(h_group) File "/usr/local/lib/python2.7/dist-packages/hickle.py", line 662, in load_dataset return np.array(data) MemoryError

Anyone else encountered this ?

nayyeraafaq avatar Mar 11 '18 09:03 nayyeraafaq

Do you have enough RAM (or virtual memory)?

ArnaudVella avatar Mar 13 '18 07:03 ArnaudVella

I have 32GB RAM and 12GB GPU. available memory is around 28GB. But one file size is around 33.1 GB. Were you able to reproduce the results. Any idea whats wrong. Thanks

nayyeraafaq avatar Mar 13 '18 08:03 nayyeraafaq

@nayyeraafaq Did you solve memory error?? how did you solve this problem?

SinDongHwan avatar Jul 03 '18 05:07 SinDongHwan

reduce the batch size

saiganesh185 avatar Jul 20 '18 09:07 saiganesh185

Reduce batch size does not work. You can increase the swap space if you work in Linux.

chaoyan1037 avatar Jul 28 '18 18:07 chaoyan1037

Reduce batch size does not work. You can increase the swap space if you work in Linux.

Same issue and your suggestion worked for me. Follow this link to add up your swap space. https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04

giangnguyen2412 avatar Feb 13 '19 09:02 giangnguyen2412