How to deploy the pytorch model?

I am a novice.
I don’t learn about caffe2,so I use the flask to deploy the model with python.
But I don’t know which is better?Does caffe2 is faster?or if I optimize the inference code and the model,I can get the similar speed?

I think it depends on your use case.
As far as I understand your current PyTorch model runs in a Flask app and works.
Do you see any bottlenecks regarding the performance, i.e. do you expect a huge workload which your current approach cannot handle?

I would look for the current bottlenecks and optimize according to these.

Here’s a tutorial for deploying a pytorch model: https://pytorch.org/tutorials/beginner/deploy_seq2seq_hybrid_frontend_tutorial.html. Hope it helps.

what was your model? i m struggling to figure out how to deploy a linear regression model. do we need to save the weights ?