You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
Debug mode: off
Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [21/Feb/2020 16:47:21] "?[33mPOST /predict/ HTTP/1.1?[0m" 404 -
client:
打印post返回的结果
<Response [404]>
Traceback (most recent call last):
File "e:/RiseFile/Deeplearning/Deploy/myModleDeploy/Flask/examples/deploy-pytorch-model/simple_request.py", line 40, in
predict_result(args.file)
File "e:/RiseFile/Deeplearning/Deploy/myModleDeploy/Flask/examples/deploy-pytorch-model/simple_request.py", line 22, in predict_result
r = r.json()
File "D:\Anaconda3\envs\py36\lib\site-packages\requests\models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "D:\Anaconda3\envs\py36\lib\json_init_.py", line 354, in loads
return _default_decoder.decode(s)
File "D:\Anaconda3\envs\py36\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "D:\Anaconda3\envs\py36\lib\json\decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The text was updated successfully, but these errors were encountered:
In run_pytorch_server file, at around line 89, try converting the label to float before passing it idx2label.
label_name = idx2label[float(label)]
like this, this solved it for me.
flask_server:
Loading PyTorch model and Flask starting server ...
Please wait until server has fully started
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
127.0.0.1 - - [21/Feb/2020 16:47:21] "?[33mPOST /predict/ HTTP/1.1?[0m" 404 -
client:
打印post返回的结果
<Response [404]>
Traceback (most recent call last):
File "e:/RiseFile/Deeplearning/Deploy/myModleDeploy/Flask/examples/deploy-pytorch-model/simple_request.py", line 40, in
predict_result(args.file)
File "e:/RiseFile/Deeplearning/Deploy/myModleDeploy/Flask/examples/deploy-pytorch-model/simple_request.py", line 22, in predict_result
r = r.json()
File "D:\Anaconda3\envs\py36\lib\site-packages\requests\models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "D:\Anaconda3\envs\py36\lib\json_init_.py", line 354, in loads
return _default_decoder.decode(s)
File "D:\Anaconda3\envs\py36\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "D:\Anaconda3\envs\py36\lib\json\decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
The text was updated successfully, but these errors were encountered: