1. tensorflow模型文件打包成PB文件
import tensorflow as tf
from tensorflow.python.tools import freeze_graph
with tf.Graph().as_default():
with tf.device("/cpu:0"):
config = tf.ConfigProto(allow_soft_placement=True)
with tf.Session(config=config).as_default() as sess:
model = Your_Model_Name()
1