deploy-pytorch-model
deploy-pytorch-model copied to clipboard
post返回的结果:404,是什么原因呢
flask_server: Loading PyTorch model and Flask starting server ... Please wait until server has fully started
- Serving Flask app "run_pytorch_server" (lazy loading)
- 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
同样问题
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.
yes, this solved it also for me. thanks!