lichengunc / refer-parser2

Referring Expression Parser
26 stars 7 forks source link

An exception message when parsing expressions using Stanford Parser #2

Closed murrayismemelai closed 5 years ago

murrayismemelai commented 6 years ago

Hello, When I do the first step (python parse_sents.py --dataset refcoco --splitBy unc --num_workers 4), I got exception message :

loading dataset refcoco into memory... creating index... index created. DONE (t=7.15s) Exception in thread Thread-2: Traceback (most recent call last): File "/home/larrymaw/anaconda2/lib/python2.7/threading.py", line 801, in bootstrap_inner self.run() File "/home/larrymaw/anaconda2/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.__kwargs) File "parse_sents.py", line 50, in worker core = load_corenlp(params) File "parse_sents.py", line 23, in load_corenlp core = StanfordCoreNLP(params['corenlp_model']) File "/home/larrymaw/MAttNet/pyutils/refer-parser2/pyutils/corenlp/corenlp.py", line 349, in init__ self._spawn_corenlp() File "/home/larrymaw/MAttNet/pyutils/refer-parser2/pyutils/corenlp/corenlp.py", line 338, in _spawncorenlp self.corenlp.expect("\nNLP> ") File "/home/larrymaw/anaconda2/lib/python2.7/site-packages/pexpect/spawnbase.py", line 341, in expect timeout, searchwindowsize, async) File "/home/larrymaw/anaconda2/lib/python2.7/site-packages/pexpect/spawnbase.py", line 369, in expect_list return exp.expect_loop(timeout) File "/home/larrymaw/anaconda2/lib/python2.7/site-packages/pexpect/expect.py", line 117, in expect_loop return self.eof(e) File "/home/larrymaw/anaconda2/lib/python2.7/site-packages/pexpect/expect.py", line 63, in eof raise EOF(msg) EOF: End Of File (EOF). Exception style platform. <pexpect.pty_spawn.spawn object at 0x7f3f5a4b06d0> command: /home/larrymaw/jvm/jdk1.8.0_151/bin/java args: ['/home/larrymaw/jvm/jdk1.8.0_151/bin/java', '-Xmx3g', '-cp', 'edu.stanford.nlp.pipeline.StanfordCoreNLP', '-props', '/home/larrymaw/MAttNet/pyutils/refer-parser2/pyutils/corenlp/default.properties'] buffer (last 100 chars): '' before (last 100 chars): 'ld not create the Java Virtual Machine.\r\nError: A fatal exception has occurred. Program will exit.\r\n' after: <class 'pexpect.exceptions.EOF'> match: None match_index: None exitstatus: None flag_eof: True pid: 31154 child_fd: 5 closed: False timeout: 30 delimiter: <class 'pexpect.exceptions.EOF'> logfile: None logfile_read: None logfile_send: None maxread: 8192 ignorecase: False searchwindowsize: 80 delaybeforesend: 0.05 delayafterclose: 0.1 delayafterterminate: 0.1 searcher: searcher_re: 0: re.compile('\nNLP> ')

Could someone tell me how to resolve it?

Thank you very much.

Fitz1003Miao commented 5 years ago

You need to add "stanford-nlp 3.5.2" to "models" dir.

abhinavkaul95 commented 3 years ago

Same error. Tried adding the stanford-nlp 3.5.2 jar file to models dir but that does not solve the issue.

Seems like running the java command directly like java -Xmx3g -cp edu.stanford.nlp.pipeline.StanfordCoreNLP -props /media/disk/user/abhinav/refer-parser2/pyutils/corenlp/default.properties, gives the error:

Unrecognized option: -props
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

and the errors could be related. The java version installed is 1.8.0_282.