久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

TensorFlow 用戶是否應(yīng)該更喜歡 SavedModel 而不是 C

Should TensorFlow users prefer SavedModel over Checkpoint or GraphDef?(TensorFlow 用戶是否應(yīng)該更喜歡 SavedModel 而不是 Checkpoint 或 GraphDef?)
本文介紹了TensorFlow 用戶是否應(yīng)該更喜歡 SavedModel 而不是 Checkpoint 或 GraphDef?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

來自SavedModel Docs,

SavedModel,TensorFlow 模型的通用序列化格式.

SavedModel, the universal serialization format for TensorFlow models.

SavedModel 包裝了一個(gè) TensorFlow Saver.Saver 主要用于生成變量檢查點(diǎn).

SavedModel wraps a TensorFlow Saver. The Saver is primarily used to generate the variable checkpoints.

根據(jù)我的理解,如果有人想使用 TensorFlow Serving,SavedModel 是必須的.但是,我可以在沒有 SavedModel 的情況下將 Tensorflow 模型部署到服務(wù)服務(wù)器:凍結(jié)圖形并將其導(dǎo)出為 GraphDef,并使用 ReadBinaryProto 和創(chuàng)建在 C++ 或 在 Go 中導(dǎo)入.

From my understanding, SavedModel is must if someone wants use TensorFlow Serving. However, I can deploy Tensorflow Model to service server without SavedModel: Freeze graph and export it as GraphDef, and load graph into Session using ReadBinaryProto and Create in C++ or Import in Go.

SavedModel 的目的是什么?用戶是否應(yīng)該更喜歡 SavedModel 而非 Checkpoint 或 GraphDef 來聚合更多與模型相關(guān)的數(shù)據(jù)?

What is the purpose of SavedModel? Should users prefer SavedModel over Checkpoint or GraphDef to aggregate more data related to the model?

推薦答案

檢查點(diǎn)包含 TensorFlow 模型中(部分)變量的值.它由 Saver 創(chuàng)建,其中要么指定要保存的特定 Variable ,要么默認(rèn)保存所有(非本地)變量.

A checkpoint contains the value of (some of the) variables in a TensorFlow model. It is created by a Saver, which is either given specific Variables to save, or by default saves all (non-local) Variables.

要使用檢查點(diǎn),您需要有一個(gè)兼容的 TensorFlow Graph,其 VariableVariable 的名稱相同檢查站.(如果您沒有兼容的 Graph,您仍然可以使用 init_from_checkpoint contrib 中的實(shí)用程序.)

To use a checkpoint, you need to have a compatible TensorFlow Graph, whose Variables have the same names as the Variables in the checkpoint. (If you don't have a compatible Graph, you can still load the values stored in a checkpoint into selected Variables using the init_from_checkpoint utilities in contrib.)

SavedModel 更加全面:它包含一組 Graph (MetaGraphs,實(shí)際上,保存集合等),以及應(yīng)該與這些Graphs兼容的檢查點(diǎn),以及運(yùn)行模型所需的任何資產(chǎn)文件(例如詞匯文件).對于它包含的每個(gè) MetaGraph,它還存儲一組簽名.簽名定義(命名)輸入和輸出張量.

SavedModel is much more comprehensive: It contains a set of Graphs (MetaGraphs, in fact, saving collections and such), as well as a checkpoint which is supposed to be compatible with these Graphs, and any asset files that are needed to run the model (e.g. Vocabulary files). For each MetaGraph it contains, it also stores a set of signatures. Signatures define (named) input and output tensors.

這意味著只要給定一個(gè) SavedModel,您就可以編寫工具(例如 tensorflow/serving,或?qū)⒊霈F(xiàn)在 中的新 saved_model 命令行實(shí)用程序工具/ 很快)解釋或執(zhí)行里面的圖形.您只需要提供數(shù)據(jù)即可.

This means that given only a SavedModel, you can write tools (such as tensorflow/serving, or the new saved_model command line utility that will appear in tools/ shortly) that interpret or execute the graphs inside. All you have to provide is the data.

如果有疑問,我總是會在編寫 SavedModel 方面犯錯(cuò),而不僅僅是一個(gè)檢查點(diǎn).這不僅允許您使用 tensorflow/serving(以及其他數(shù)量會增加的簡潔實(shí)用程序),它還確保您擁有運(yùn)行模型所需的所有信息.沒有什么比檢查點(diǎn)更令人沮喪的了,您無法再使用它,因?yàn)槟薷牧四P停F(xiàn)在它與檢查點(diǎn)文件不兼容,您要做的就是通過它運(yùn)行一些預(yù)測以進(jìn)行比較.

If in doubt, I would always err on the side of writing a SavedModel, not just a checkpoint. Not only does this allow you to use tensorflow/serving (and other neat utilities that will grow in number), it makes sure that you have all the information necessary to run the model. Nothing is more frustrating than a checkpoint you cannot use any more because you modified your model and now it is incompatible with checkpoint files and all you want to do is run some predictions through it for comparison.

這篇關(guān)于TensorFlow 用戶是否應(yīng)該更喜歡 SavedModel 而不是 Checkpoint 或 GraphDef?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Assertion failed (size.widthgt;0 amp;amp; size.heightgt;0)(斷言失敗(size.width0 amp;amp; size.height0))
Rotate an image in C++ without using OpenCV functions(在 C++ 中旋轉(zhuǎn)圖像而不使用 OpenCV 函數(shù))
OpenCV: process every frame(OpenCV:處理每一幀)
Why can#39;t I open avi video in openCV?(為什么我不能在 openCV 中打開 avi 視頻?)
OpenCV unable to set up SVM Parameters(OpenCV 無法設(shè)置 SVM 參數(shù))
Convert a single color with cvtColor(使用 cvtColor 轉(zhuǎn)換單一顏色)
主站蜘蛛池模板: 色视频网站 | 懂色中文一区二区三区在线视频 | 中文av在线播放 | 日韩av电影院| 国产精品视频一区二区三区 | 欧美性影院 | 欧美精品国产精品 | 黄色一级毛片 | 免费一级大片 | 久久久精品综合 | 中文字幕一区二区不卡 | 在线免费观看成年人视频 | 日韩久久久久久 | 日韩电影在线一区 | 亚洲国产激情 | ririsao久久精品一区 | 亚洲精品一区二区网址 | 成人精品国产 | 69av网| 国产成人在线观看免费 | 久久久精品天堂 | 欧美中文一区 | 国产精品视频网址 | 日韩网站在线观看 | 五十女人一级毛片 | 久久国产精品72免费观看 | 91久久久久久久久久久久久 | 久久久久久免费精品一区二区三区 | 亚洲国产网 | 免费一级欧美在线观看视频 | 亚洲精品久久区二区三区蜜桃臀 | 国产欧美一区二区三区日本久久久 | 麻豆精品国产91久久久久久 | 国产91在线 | 中日 | 羞羞视频一区二区 | 狠狠狠干| 国产免费又黄又爽又刺激蜜月al | 国产91久久久久久久免费 | 一区二区三区日韩 | www国产亚洲精品 | 人人九九精 |