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

TensorFlow 用戶是否應該更喜歡 SavedModel 而不是 C

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

問題描述

來自SavedModel Docs,

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

SavedModel, the universal serialization format for TensorFlow models.

SavedModel 包裝了一個 TensorFlow Saver.Saver 主要用于生成變量檢查點.

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

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

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 的目的是什么?用戶是否應該更喜歡 SavedModel 而非 Checkpoint 或 GraphDef 來聚合更多與模型相關的數據?

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

推薦答案

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

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.

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

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,實際上,保存集合等),以及應該與這些Graphs兼容的檢查點,以及運行模型所需的任何資產文件(例如詞匯文件).對于它包含的每個 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.

這意味著只要給定一個 SavedModel,您就可以編寫工具(例如 tensorflow/serving,或將出現在 中的新 saved_model 命令行實用程序工具/ 很快)解釋或執行里面的圖形.您只需要提供數據即可.

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 方面犯錯,而不僅僅是一個檢查點.這不僅允許您使用 tensorflow/serving(以及其他數量會增加的簡潔實用程序),它還確保您擁有運行模型所需的所有信息.沒有什么比檢查點更令人沮喪的了,您無法再使用它,因為您修改了模型,現在它與檢查點文件不兼容,您要做的就是通過它運行一些預測以進行比較.

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.

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

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

相關文檔推薦

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++ 中旋轉圖像而不使用 OpenCV 函數)
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 無法設置 SVM 參數)
Convert a single color with cvtColor(使用 cvtColor 轉換單一顏色)
主站蜘蛛池模板: 亚洲国产精品一区二区三区 | 国产在线不卡视频 | 久久精品欧美一区二区 | 中文字幕在线观看第一页 | 日韩在线视频免费 | www.欧美日韩 | 免费a在线 | 特黄一级片 | 日韩黄色免费视频 | 欧美一级淫片免费视频魅影视频 | 高清一级片 | 97超碰资源总站 | 美女一级片 | 日本精品在线视频 | 神马福利视频 | 日本一级片在线观看 | 午夜视频福利 | 羞羞网站在线观看 | 色污污| 神马午夜久久 | 高潮毛片又色又爽免费 | 亚洲精品色 | 亚洲小视频在线观看 | 久久天天 | 四虎黄色片 | 80日本xxxxxxxxx96 国产成人在线免费视频 | 黄色片网站在线观看 | 亚洲国产精品一区二区三区 | 欧美日韩亚洲一区二区三区 | 成人一区二区视频 | 五月天婷婷在线观看 | 久久久久久免费毛片精品 | 日本在线播放 | 日韩在线精品视频 | 天天爽夜夜操 | 日皮视频在线观看 | 国产精品久久网 | 中文字幕在线观看免费视频 | 久久不雅视频 | 亚洲黄色三级 | 天天爱综合 |