【VSCode部署模型】导出TensorFlow2.X训练好的模型信息

参考tensorflow2.0 C++加载python训练保存的pb模型

经过模型训练及保存,我们得到"OptimalModelDataSet2"文件夹,模型的保存方法(.h5.pb文件),参考【Visual Studio Code】c/c++部署tensorflow训练的模型

其中"OptimalModelDataSet2"文件夹保存着训练好的模型数据"saved_model.pb"

bash 复制代码
要在OptimalModelDataSet2所在的文件夹下执行:
$ saved_model_cli show --dir ./OptimalModelDataSet2
会得到:
The given SavedModel contains the following tag-sets:
'serve'
使用'serve',继续执行:
$ saved_model_cli show --dir ./OptimalModelDataSet2/ --tag_set serve
会得到:
The given SavedModel MetaGraphDef contains SignatureDefs with the following keys:
SignatureDef key: "__saved_model_init_op"
SignatureDef key: "serving_default"
使用上述信息,继续:
$ saved_model_cli show --dir ./OptimalModelDataSet2/ --tag_set serve --signature_def serving_default
得到:
The given SavedModel SignatureDef contains the following input(s):
  inputs['input_1'] tensor_info:
      dtype: DT_FLOAT
      shape: (-1, 24)
      name: serving_default_input_1:0
The given SavedModel SignatureDef contains the following output(s):
  outputs['dense_30'] tensor_info:
      dtype: DT_FLOAT
      shape: (-1, 1)
      name: StatefulPartitionedCall:0
Method name is: tensorflow/serving/predict
这里输入和输出的name,要留好,c中调用会用到。
相关推荐
魔力之心8 小时前
TensorFlow2 study notes[1]
人工智能·python·tensorflow
lishaoan771 天前
用TensorFlow进行逻辑回归(一)
人工智能·tensorflow·逻辑回归·分类器
路溪非溪3 天前
Tensorflow的安装记录
人工智能·tensorflow·neo4j
lishaoan774 天前
使用tensorflow的线性回归的例子(十二)
人工智能·tensorflow·线性回归·戴明回归
19894 天前
【零基础学AI】第31讲:目标检测 - YOLO算法
人工智能·rnn·yolo·目标检测·tensorflow·lstm
盼小辉丶4 天前
TensorFlow深度学习实战——基于自编码器构建句子向量
人工智能·深度学习·tensorflow
Jay Kay5 天前
TensorFlow内核剖析:分布式TensorFlow架构解析与实战指南
分布式·架构·tensorflow
盼小辉丶5 天前
TensorFlow深度学习实战——去噪自编码器详解与实现
人工智能·深度学习·tensorflow
Blossom.1186 天前
机器学习在智能制造业中的应用:质量检测与设备故障预测
人工智能·深度学习·神经网络·机器学习·机器人·tensorflow·sklearn
19896 天前
【零基础学AI】第26讲:循环神经网络(RNN)与LSTM - 文本生成
人工智能·python·rnn·神经网络·机器学习·tensorflow·lstm