Skip to content

FileNotFoundError: [Errno 2] for local server POST #17

@starmpcc

Description

@starmpcc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions