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

A Strange Error OSError: [Errno 12] Cannot allocate memory #7

Closed
czhxiaohuihui opened this issue Nov 1, 2020 · 2 comments
Closed

Comments

@czhxiaohuihui
Copy link

czhxiaohuihui commented Nov 1, 2020

Calculating Evalaution Metric Scores......

loading annotations into memory...
0:00:00.743513
creating index...
index created!
Loading and preparing results...
DONE (t=0.07s)
creating index...
index created!
tokenization...
Traceback (most recent call last):
File "/home/chenzhanghui/.pycharm_helpers/pydev/pydevd.py", line 1741, in
main()
File "/home/chenzhanghui/.pycharm_helpers/pydev/pydevd.py", line 1735, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/home/chenzhanghui/.pycharm_helpers/pydev/pydevd.py", line 1135, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/chenzhanghui/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/chenzhanghui/code/showEditAndTell/editnet.py", line 828, in
word_map = word_map)
File "/home/chenzhanghui/code/showEditAndTell/editnet.py", line 727, in evaluate
cocoEval.evaluate()
File "coco-caption/pycocoevalcap/eval.py", line 36, in evaluate
gts = tokenizer.tokenize(gts)
File "coco-caption/pycocoevalcap/tokenizer/ptbtokenizer.py", line 54, in tokenize
stdout=subprocess.PIPE)
File "/home/chenzhanghui/anaconda3/envs/py36/lib/python3.6/subprocess.py", line 729, in init
restore_signals, start_new_session)
File "/home/chenzhanghui/anaconda3/envs/py36/lib/python3.6/subprocess.py", line 1295, in _execute_child
restore_signals, start_new_session, preexec_fn)
File "/home/chenzhanghui/.pycharm_helpers/pydev/_pydev_bundle/pydev_monkey.py", line 424, in new_fork_exec
return getattr(_posixsubprocess, original_name)(args, *other_args)
OSError: [Errno 12] Cannot allocate memory

When running the editnet.py, the error occurs.

Mostly because of this line of code in the class PTBTokenizer.
p_tokenizer = subprocess.Popen(cmd, cwd=path_to_jar_dirname,
stdout=subprocess.PIPE)
But I don't know how to solve it....

Can you help me with this?
When I run the dcnet.py, it can work normally !!!

@fawazsammani
Copy link
Owner

fawazsammani commented Nov 3, 2020

Hi. The METEOR metric creates another subprocess each time its called, and does not destroy the previous one. Therefore, each time you call METEOR, memory increases. Although this is a rare phenomenon, it can still happen. To solve this, add self.meteor_p.kill() after line 44 in meteor.py. Hope this helps. Feel free to re-open this issue if it didn't work.

@zxh19976666
Copy link

Hello!how to get the aoa_caps/results_train_beam+str(beam).json?
thanks!

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

3 participants