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

[Bug]: 运行python client 出错 #5850

Closed
1 task done
cqray1990 opened this issue May 7, 2023 · 3 comments
Closed
1 task done

[Bug]: 运行python client 出错 #5850

cqray1990 opened this issue May 7, 2023 · 3 comments
Assignees
Labels
bug Something isn't working triage

Comments

@cqray1990
Copy link

软件环境

- paddlepaddle-gpu: 2.4.2
- paddlenlp: 2.5.2

CUDA 10.2
cudnn  8.7

重复问题

  • I have searched the existing issues

错误描述

Traceback (most recent call last):
  File "/PaddleNLP/model_zoo/uie/deploy/serving/simple_serving/client.py", line 28, in <module>
    datas = json.loads(r.text)
  File "anaconda3/lib/python3.10/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "anaconda3/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "anaconda3/lib/python3.10/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

稳定复现步骤 & 代码

as https://github.com/PaddlePaddle/PaddleNLP/blob/develop/docs/server.md said
first:
paddlenlp server server:app --host 0.0.0.0 --port 8189 --workers 1
然后在另外的终端运行

python client.py

Traceback (most recent call last):
File "/PaddleNLP/model_zoo/uie/deploy/serving/simple_serving/client.py", line 28, in
datas = json.loads(r.text)
File "anaconda3/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "anaconda3/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "anaconda3/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@cqray1990 cqray1990 added the bug Something isn't working label May 7, 2023
@github-actions github-actions bot added the triage label May 7, 2023
@LemonNoel
Copy link
Contributor

可以在报错前一行打印下 r.text,可能是返回结果为空

@cqray1990
Copy link
Author

可以在报错前一行打印下 r.text,可能是返回结果为空
打印出:r.text
test: Connection error

一个终端运行:
paddlenlp server server:app --host 0.0.0.0 --port 8189 --workers 1:

warnings.warn("Setuptools is replacing distutils.")
[2023-05-11 22:26:57,037] [ INFO] - starting to PaddleNLP SimpleServer...
[2023-05-11 22:26:57,038] [ INFO] - The PaddleNLP SimpleServer is starting, backend component uvicorn arguments as follows:
[2023-05-11 22:26:57,038] [ INFO] - the starting argument [host]=0.0.0.0
[2023-05-11 22:26:57,038] [ INFO] - the starting argument [port]=8189
[2023-05-11 22:26:57,038] [ INFO] - the starting argument [log_level]=None
[2023-05-11 22:26:57,038] [ INFO] - the starting argument [workers]=1
[2023-05-11 22:26:57,038] [ INFO] - the starting argument [limit_concurrency]=None
[2023-05-11 22:26:57,038] [ INFO] - the starting argument [limit_max_requests]=None
[2023-05-11 22:26:57,038] [ INFO] - the starting argument [timeout_keep_alive]=15
[2023-05-11 22:26:57,038] [ INFO] - the starting argument [app_dir]=PaddleNLP/model_zoo/uie/deploy/serving/simple_serving
[2023-05-11 22:26:57,038] [ INFO] - the starting argument [reload]=False
[2023-05-11 22:27:04,787] [ INFO] - We are using <class 'paddlenlp.transformers.ernie.tokenizer.ErnieTokenizer'> to load '../../checkpoint/model_best/'.
[2023-05-11 22:27:04,804] [ INFO] - Taskflow request [path]=/taskflow/uie is genereated.
INFO: Started server process [32534]
[2023-05-11 22:27:04,808] [ INFO] server.py:84 - Started server process [32534]
INFO: Waiting for application startup.
[2023-05-11 22:27:04,809] [ INFO] on.py:45 - Waiting for application startup.
INFO: Application startup complete.
[2023-05-11 22:27:04,809] [ INFO] on.py:59 - Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:8189 (Press CTRL+C to quit)
[2023-05-11 22:27:04,809] [ INFO] server.py:217 - Uvicorn running on http://0.0.0.0:8189 (Press CTRL+C to quit)

另外一个:
python client.py 怎么会打印连接错误,双卡,大师默认会用一张的吧

Traceback (most recent call last):
File "/PaddleNLP/model_zoo/uie/deploy/serving/simple_serving/client.py", line 29, in
datas = json.loads(r.text)
File "anaconda3/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "anaconda3/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "anaconda3/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@huangjun11
Copy link

你好,请问你的问题解决了吗,我也是遇到这种问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

4 participants