当前位置:网站首页>004. Torchserve calls LR two category prediction
004. Torchserve calls LR two category prediction
2022-06-13 12:11:00 【nsq1101】
Preface
Pytorch Within the framework of ,LR Model II classification prediction
Model code reference Logistic Return to ( Achieve two categories )
One 、 The overall steps
1、 Run the code in the blog , Save the model
model_script = torch.jit.script(model)
model_script.save('/Users/serve/model-archiver/LR_scr.pt')
2、 To mar Format
"""
model-archiver % torch-model-archiver -f --model-name LR_scr \--version 1.0 \
--serialized-file LR_scr.pt \
--handler /Users/hb/Desktop/sheng/quan/Coding/Test/LRHandler.py \
--export-path model-store/
"""
3、 function docker
"""
docker run --rm -it -p 8080:8080 -p 8081:8081 --name mar -v $(pwd)/model-store:/home/model-server/model-store -v $(pwd)/examples:/home/model-server/examples pytorch/torchserve:latest
"""
4、 Registration model
"""
curl --location --request POST 'http://localhost:8081/models' \
--header 'Content-Type: application/json' \
--data-raw '{
"url": "LR_scr.mar",
"batch_size": 64,
"initial_workers": 1
}'
"""
5、 forecast
"""
curl --location --request POST 'http://localhost:8080/predictions/LR_scr' \
--header 'Content-Type: application/json' \
--data-raw '[4.1]'
"""
Two 、 summary
1、Pytorch Run a model under the framework , Save as pt Format
2、 The way of data preprocessing , To mar Format , stay handler.py According to the input data , Format transformation
3、 Display of output results
边栏推荐
- Branch prediction of CPU
- 面试突击56:聚簇索引和非聚簇索引有什么区别?
- Based on STM32F103 - matrix key + serial port printing
- Kubernetes deploying ActiveMQ
- 【TcaplusDB知识库】TcaplusDB-tcapsvrmgr工具介绍(一)
- Machine learning (III) - LDA (linear discriminant analysis) theory and code explanation
- 【管理知多少】“风险登记册”本身的风险
- 行业领先的界面组件包DevExpress 6月正式发布v21.2.8
- Analysis of different dimensions of enterprise evaluators: enterprise evaluation of Gansu Power Investment Capital Management Co., Ltd
- Idea usage
猜你喜欢
Web development video tutorial, web development teaching
web开发视频教程,web开发教学
Web developer, web development background development
OpenCV学习笔记(二):读取mnist数据集
Lightweight real-time semantic segmentation: eNet & erfnet
2022.2:EyeshotPro EyeshotUltimate EyeshotFem
致力超表面光子芯片产品研发与制造,山河光电完成数千万元Pre-A轮融资
How to use dataX to update the data in the downstream Oracle database with the update semantics?
树莓派开发笔记(十六):树莓派4B+安装mariadb数据库(mysql开源分支)并测试基本操作
[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (II)
随机推荐
The answer to the subject of "Regulations" of the second construction company in 2022 has been provided. Please keep it
我们的B端SaaS为什么生存得如此艰难
基於STM32F103+AS608指紋模塊+4X4矩陣按鍵+SIM900A發短信——智能門禁卡系統
[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (III)
Auto. JS floating window centered
自己炒股怎么开户?安全可靠吗?
Based on STM32F103 - matrix key + serial port printing
[benefits] in minutes
Web development project, web single page development
机器学习(一)—线性回归理论与代码详解
kubernetes 部署 ActiveMQ
北京市场监管局启动9类重点产品质量专项整治工作
Pulsar 消费者
基于STM32F103——AS608指纹模块+串口打印
[tcapulusdb knowledge base] Introduction to tcapulusdb table data caching
Lucene from introduction to practice
11、PCA 介绍
我和指针那些事——初识指针
[tcaplusdb knowledge base] Introduction to tcaplusdb tcapulogmgr tool (II)
【福利】,分分钟搞定