Triton_server部署学习笔记

下载镜像

docker pill http://nvcr.io/nvidia/tritonserver:22.07-py3

docker run --gpus all -itd -p8000:8000 -p8001:8001 -p8002:8002 -v /home/ai-developer/server/docs/examples/model_repository/:/models nvcr.io/nvidia/tritonserver:22.07-py3

docker exec -it a5bc bash

tritonserver --model-repository=/models --strict-model-config=false



非必要config文件

支持的格式有TrnsorRT,TensorFLOW saved-model,ONNX models do not require config.pbtxt when --strict-model-config=false

config中,platfrom可填写Tensorrt_plan,onnxruntime_onnx,pytorch_libtorch

backend tensorrt,onnxruntime,pytorch

dims: [ 3,-1,-1 ] -1代表可变维度

--model-control-model explicit

git clone https://github.com/NVIDIA/DeepLearningExamples.git

cd data/squad/

下载数据集

sh squad_download.sh

模型映射文件地址

cd /models

下载演示模型的地址

https://catalog.ngc.nvidia.com/orgs/nvidia/models/bert_pyt_ckpt_large_qa_squad11_amp

#粘贴wget命令

wget --content-disposition https://api.ngc.nvidia.com/v2/models/nvidia/bert_pyt_ckpt_large_qa_squad11_amp/versions/19.09.0/zip -O bert_pyt_ckpt_large_qa_squad11_amp_19.09.0.zip

转换格式

python3 triton/export_model.py

--input-path triton/model.py

--input-type pyt

--output-path $/models/exported_model.onnx

--output-type onnx

--dataloader triton/dataloader.py

--ignore-unknown-parameters

--onnx-opset 13

${FLAG}

--config-file bert_configs/large.json

--checkpoint /models/bert_large_qa.pt

--precision fp16

--vocab-file /models/vocab.txt

--max-seq-length 34

--predict-file /opt/tritonserver/DeepLearningExamples/PyTorch/LanguageModeling/BERT/data/squad/v1.1/dev-v1.1.json

--batch-size 16

相关推荐
孤寂大仙v2 小时前
【Linux笔记】理解文件系统(上)
linux·运维·笔记
ianozo2 小时前
数据结构--【栈与队列】笔记
数据结构·笔记
极客BIM工作室3 小时前
机器学校的考试风波:误差分析、过拟合和欠拟合
笔记·机器学习
flashier3 小时前
C语言 进阶指针学习笔记
c语言·笔记·学习
大白的编程日记.3 小时前
【Linux学习笔记】Linux基本指令分析和权限的概念
linux·笔记·学习
螺旋式上升abc3 小时前
GO语言学习笔记
笔记·学习·golang
W起名有点难4 小时前
前端学习——CSS
前端·css·学习
Moonnnn.4 小时前
51单片机——汇编工程建立、仿真、调试全过程
汇编·笔记·嵌入式硬件·学习·51单片机
画个逗号给明天"5 小时前
TinyWebServer项目笔记——02 半同步半反应堆线程池
笔记
不会聊天真君6475 小时前
HTML5(Web前端开发笔记第一期)
笔记·html5