Skip to Content
机器学习流水线实战
book

机器学习流水线实战

by Hannes Hapke, Catherine Nelson
November 2021
Intermediate to advanced
302 pages
8h 57m
Chinese
Posts & Telecom Press
Content preview from 机器学习流水线实战
使用
TensorFlow Serving
进行进阶模型部署
149
docker run -p 8500:8500 \
-p 8501:8501 \
-e MODEL_BASE_PATH=gcp://
bucketname
/
model_path
/ \
-e MODEL_NAME=
my_model
\
-v /home/
your_username
/.credentials/:/credentials/
-e GOOGLE_APPLICATION_CREDENTIALS=/
credentials
/
sa-credentials.json
\
-t tensorflow/serving
挂载本地证书路径。
指定容器中的证书路径。
这样就可以将远程
GCP
bucket
作为存储位置了。
9.1.2
 优化远程模型加载
无论是使用本地存储还是云端存储,
TensorFlow Serving
都会默认每两秒对文件系统进行一
次轮询和模型版本更新。如果使用了云端存储,那么轮询操作会通过云服务生成一个存储
桶列表视图。如果经常更新模型版本,那么存储桶里就会填满大量的文件。这会生成大量
的列表视图信息,并且随着时间的推移占用极大的流量。这些操作所产生的流量会增加使
用云服务的成本。为了避免高昂的云服务费用,建议将轮询频率降低到每两分钟一次。在
这种设置下,流量消耗会减少到原来的
1/60
,而且每小时仍然能对模型进行
30
次更新:
docker run -p 8500:8500 \
...
-t tensorflow/serving ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
可编程网络自动化

可编程网络自动化

Jason Edelman, Scott S. Lowe, Matt Oswalt
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9787115573216