BERN2: FileNotFoundError: [Errno 2] for local server POST
Hello. I installed BERN2 in my VM (Ubuntu 18.04 x64, 1 GPU). It succesfully installed, however, if I run example post script on READAME.md, then the below error occured. (Server console log)
[23/Mar/2022 06:02:40.831728] [550f7242b14dc039a8a5ee6aa9233f3472dd7b4a33484f5955175a4d] GNormPlus 0.0001380443572998047 sec
Traceback (most recent call last):
File "/home/vessl/BERN2/bern2/bern2.py", line 106, in annotate_text
output = self.tag_entities(text, base_name)
File "/home/vessl/BERN2/bern2/bern2.py", line 358, in tag_entities
async_result = loop.run_until_complete(self.async_ner(arguments_for_coroutines))
File "/home/vessl/miniconda3/envs/bern2/lib/python3.7/asyncio/base_events.py", line 587, in run_until_complete
return future.result()
File "/home/vessl/BERN2/bern2/bern2.py", line 491, in async_ner
result = await asyncio.gather(*coroutines)
File "/home/vessl/BERN2/bern2/bern2.py", line 533, in _ner_wrap
with open(output_mtner, 'r', encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: './multi_ner/output/550f7242b14dc039a8a5ee6aa9233f3472dd7b4a33484f5955175a4d.PubTator.json'
[2022-03-23 06:02:41,425] ERROR in app: Exception on /plain [POST]
Traceback (most recent call last):
File "/home/vessl/miniconda3/envs/bern2/lib/python3.7/site-packages/flask/app.py", line 2073, in wsgi_app
response = self.full_dispatch_request()
File "/home/vessl/miniconda3/envs/bern2/lib/python3.7/site-packages/flask/app.py", line 1518, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/vessl/miniconda3/envs/bern2/lib/python3.7/site-packages/flask/app.py", line 1516, in full_dispatch_request
rv = self.dispatch_request()
File "/home/vessl/miniconda3/envs/bern2/lib/python3.7/site-packages/flask/app.py", line 1502, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
File "/home/vessl/BERN2/app/__init__.py", line 85, in plain_api
return Response(json.dumps({"error_message": result_dict["error_message"]}), status=404, content_type='application/json')
NameError: name 'Response' is not defined
127.0.0.1 - - [23/Mar/2022 06:02:41] "POST /plain HTTP/1.1" 500 -
nohup_multi_ner.out log
MTNER init_t 28.547 sec.
1it [00:00, 185.89it/s]
Prediction: 100%|██████████| 1/1 [00:00<00:00, 2.28it/s]
Traceback (most recent call last):
File "multi_ner/ner_server.py", line 91, in <module>
run_server(mt_ner, args)
File "multi_ner/ner_server.py", line 63, in run_server
mtner_recognize(model, dict_path, base_name, args)
File "multi_ner/ner_server.py", line 47, in mtner_recognize
with open(output_mt_ner, 'w', encoding='utf-8') as f:
PermissionError: [Errno 13] Permission denied: 'multi_ner/output/550f7242b14dc039a8a5ee6aa9233f3472dd7b4a33484f5955175a4d.PubTator.json'
Thank you.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 26 (11 by maintainers)
Hi, I’m getting a similiar error.
But I tried to reinstalled CRF+±0.58 ,renamed it and tried: $ ./configure --prefix=“$HOME” $ make $ make install
the log still shows:
In addition, I am on Linux and my gcc version is 7.5.0(Ubuntu 7.5.0-3ubuntu1~18.04) .i notice the information above, crf_test is in my GNormPlusJava/CRF directory and there is nothing in my GNormPlusJava/output directory but I don’t know how to fix it.
Hi @starmpcc @ixalidamus @lengluodefanhua
First of all, I removed
sudofrom run_bern2.sh after verifying that BERN2 can run without it.It’s most likely that the external modules (Multi-NER, tmVar, GNormPlus, etc.) are causing the issue. The reasons are various, so we need to check the logs.
The log files are saved in
/logsso you can check them to see which module is causing the issue.If you find anything suspicious in the logs, please share it with me so that I can help you.