开发深度学习模型一般需要借助深度学习库(Tensorflow、pytorch),以下对工业环境部署深度学习模型进行梳理:
tensorflow
TF提供的开发过程中的支持最为全面
tensorflow 开发模型(丰富的模块)
tensorboard 进行可视化分析(模型、训练过程等)
docker + tensorflow serving 部署上线
image.png
pytorch
1.网页访问形式: pytorch + flask/Django
2.手机或者其他嵌入式:将pytorch的模型,利用ONNX转换为onnx格式,然后再借助其他框架(caffe,mxnet,TF等)
可以看出pytorch的模型部署方面,存在短板
3通过torchscript转为C++
综上:对于服务端开发,还是推荐tensorflow 工具更为全面;pytorch结合flask也可以用。
补充:ONNX https://onnx.ai/
Open Neural Network eXchange format
The open ecosystem for interchangeable AI models.
ONNX is an open format to represent deep learning models. With ONNX, AI developers can easily move models between state-of-the-art tools and choose the combination that is best for them.
参考:
https://www.freecodecamp.org/news/how-to-deploy-tensorflow-models-to-production-using-tf-serving-4b4b78d41700/
https://github.com/gyang274/tensorflow-serving-tutorial
https://www.tensorflow.org/tfx/tutorials/serving/rest_simple
https://www.tensorflow.org/tfx/serving/serving_basic
https://github.com/tensorflow/serving









网友评论