【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中调用会用到。
相关推荐
serve the people14 小时前
tensorflow 零基础吃透:RaggedTensor 在 Keras 和 tf.Example 中的实战用法 (补充)
人工智能·tensorflow·keras
serve the people15 小时前
tensorflow 零基础吃透:RaggedTensor 在 Keras 和 tf.Example 中的实战用法
人工智能·tensorflow·keras
瀚岳-诸葛弩17 小时前
对比tensorflow,从0开始学pytorch(二)--多尺度实现
人工智能·pytorch·tensorflow
serve the people17 小时前
tensorflow 零基础吃透:tf.data 中 RaggedTensor 的核心用法(数据集流水线)
人工智能·tensorflow·neo4j
水木姚姚2 天前
搭建 TensorFlow 在 VScode 下编程环境(Debian)
人工智能·windows·vscode·debian·tensorflow
瀚岳-诸葛弩2 天前
对比tensorflow,从0开始学pytorch(一)
人工智能·pytorch·tensorflow
serve the people2 天前
tensorflow 零基础吃透:不规则张量(RaggedTensor)vs 稀疏张量(SparseTensor)
人工智能·tensorflow·neo4j
serve the people2 天前
tensorflow 零基础吃透:不规则维度 vs 均匀维度(RaggedTensor 核心概念)
人工智能·python·tensorflow
serve the people2 天前
RaggedTensor 处理可变长度文本序列的核心实战场景
tensorflow
serve the people3 天前
TensorFlow tf.GradientTape(梯度带)的高级用法指南
人工智能·python·tensorflow