当前位置:网站首页>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
边栏推荐
- Pulsar 生产者
- 企评家分不同维度解析:甘肃电投资本管理有限责任公司企业评价
- Lvgl Library Tutorial 01- porting to STM32 (touch screen)
- Details of fitfi sports money making chain game system development mode
- Branch prediction of CPU
- What if the second construction fails to pass the post qualification examination? This article tells you
- Committed to R & D and manufacturing of ultra surface photonic chip products, Shanhe optoelectronics completed a round of pre-A financing of tens of millions of yuan
- 基于STM32F103——DS1302日期时间+串口打印
- 基于STM32F103——矩阵按键+串口打印
- 【TcaplusDB知识库】TcaplusDB-tcaplusadmin工具介绍
猜你喜欢

【TcaplusDB知识库】TcaplusDB-tcapulogmgr工具介绍(二)
![[tcapulusdb knowledge base] Introduction to tcapulusdb analytical text export](/img/ab/e6241f635c6736a0d6877ae4cf10df.png)
[tcapulusdb knowledge base] Introduction to tcapulusdb analytical text export

7.5.4:Spire Office for . NET New Version
![[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (I)](/img/1b/92cbe7050580a0124a82f70dd3ca21.png)
[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (I)

Wallys/Network_ Card/DR-NAS26/AR9223/2x2 MIMO

Seccloud and trend technology jointly release the overall solution of container cloud platform and GPU resource pooling

Web developer, web development background development

web开发者,web开发后台开发

camunda如何使用script脚本节点

Books + videos + learning notes + skill improvement resource library, interview must ask
随机推荐
break algorithm---dynamic planning(dp-arr)
2022年二建《市政》科目答案已出,请收好
面试突击56:聚簇索引和非聚簇索引有什么区别?
基于STM32F103——SIM900A发送短信+串口打印
机器学习(二)—逻辑回归理论与代码详解
(small information for children to children-03) batch template production of basic information collection folder for children (including PDF, word and certificate folder)
003、torchserve 调用LSTM模型预测
[MySQL lock table processing]
【TcaplusDB知识库】TcaplusDB-tcapsvrmgr工具介绍(一)
Industry development and research status based on 3D GIS technology
Design and implementation of database for banking system
Interview questions MySQL database
Web development project, web single page development
产品故事|你所不知道的语雀画板
Analysis of DuPont analysis method: financial analysis of the New Retail Group Co., Ltd
行业领先的界面组件包DevExpress 6月正式发布v21.2.8
Interview shock 56: what is the difference between clustered index and non clustered index?
Committed to R & D and manufacturing of ultra surface photonic chip products, Shanhe optoelectronics completed a round of pre-A financing of tens of millions of yuan
What if the second construction fails to pass the post qualification examination? This article tells you
[tcaplusdb knowledge base] Introduction to tcaplusdb tcapulogmgr tool (I)