【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中调用会用到。
相关推荐
thinkMoreAndDoMore16 小时前
keras常用层对比
深度学习·tensorflow·keras
zhendeWD2 天前
tensorflow笔记一
人工智能·tensorflow
flying_13142 天前
图神经网络分享系列-HAN(Heterogeneous Graph Attention Network)(三)
深度学习·神经网络·tensorflow·gat·han·节点级别注意力·语义级别注意力
flying_13142 天前
图神经网络分享系列-HAN(Heterogeneous Graph Attention Network)(二)
深度学习·神经网络·tensorflow·图论·图神经网络·代码实战·han
dazzle4 天前
机器学习算法原理与实践-入门(九):基于TensorFlow框架的线性回归
算法·机器学习·tensorflow
跟着珅聪学java5 天前
编写高质量 CSS 样式完全指南
人工智能·python·tensorflow
橘子编程7 天前
CSS 全栈指南:从基础到 2025 新特性
前端·css·chrome·tensorflow·less·css3·html5
Predestination王瀞潞7 天前
1.4.1 AI->TFLite模型部标准(Google主导,开源社区协作):TFLite(TensorFlow Lite)
人工智能·开源·tensorflow
Chen三变8 天前
Pytorch和Tensorflow两大架构如何安装?想在自己的电脑上跑神经网络?如何找到部署自己电脑版本的神经网络工具?人工智能专业的学生集合!!
人工智能·pytorch·tensorflow
王上上10 天前
# 【机器学习-20】-数值计算误差、逻辑回归/Softmax的数值稳定性优化、以及TensorFlow实现细节
机器学习·tensorflow·逻辑回归