久久久久久久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 轉換單一顏色)
主站蜘蛛池模板: 毛片a级 | 美女一级毛片 | 欧美精品日韩 | 国内自拍视频在线观看 | 日本爱爱视频 | 亚洲91精品 | 韩国av一区二区 | 亚洲视频在线观看免费 | 日韩在线一区二区三区 | 一区二区视频 | 91精品在线播放 | 99色视频 | 欧美成人在线影院 | 久久91| 天天综合天天 | 亚洲精品日本 | 成人福利在线视频 | 日韩精品成人 | 人人干在线 | 一区二区电影 | 精品国产91 | 国产一区二区三区在线免费观看 | 亚洲欧美成人在线 | 欧美日韩国产在线 | 亚洲午夜精品一区二区三区 | 久久99视频免费观看 | 色婷婷婷婷色 | 国产精品毛片 | 热久久免费视频 | 一区二区三区成人 | 久久精品久久久久久 | 羞视频在线观看 | 精品99爱视频在线观看 | 看av在线 | 精品国偷自产在线 | 精品欧美一区二区中文字幕视频 | 亚洲精品乱码久久久久久久久 | 91精品国产色综合久久不卡98 | 国产综合久久 | 女同av亚洲女人天堂 | 成年无码av片在线 |