xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡(jiǎn)介

把tensorflow保存的checkpoint類型模型凍結(jié),轉(zhuǎn)化為.pb模型輸出。調(diào)用方法參見我的博文https://blog.csdn.net/weixin_41864878/article/details/84957681

資源截圖

代碼片段和文件信息

import?argparse
import?tensorflow?as?tf
from?tensorflow.python.framework?import?graph_util

def?freeze_graph(input_checkpointoutput_graph?output_node_names):
????‘‘‘
????To?convert?the?TensorFlow?checkpoint?files?to?froze?graph
????:param?input_checkpoint:
????:param?output_graph:
????:return:
????‘‘‘
????saver?=?tf.train.import_meta_graph(input_checkpoint?+?‘.meta‘?clear_devices=True)
?
????with?tf.Session()?as?sess:
????????saver.restore(sess?input_checkpoint)
????????output_graph_def?=?graph_util.convert_variables_to_constants(??
????????????sess=sess
????????????input_graph_def=sess.graph_def#?:sess.graph_def
????????????output_node_names=output_node_names.split(““))#
?
????????with?tf.gfile.GFile(output_graph?“wb“)?as?f:?
??????????

評(píng)論

共有 條評(píng)論

相關(guān)資源