【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中调用会用到。
相关推荐
SugarPPig2 天前
TensorFlow 和 Transformer 的关系
人工智能·tensorflow·transformer
weixin_456904273 天前
基于Tensorflow2.15的图像分类系统
人工智能·分类·tensorflow
麦兜*6 天前
内存杀手机器:TensorFlow Lite + Spring Boot移动端模型服务深度优化方案
java·人工智能·spring boot·spring cloud·ai·tensorflow·ai编程
A5rZ6 天前
css leak -- justctf 2025 Simple Tasks
前端·css·tensorflow
盼小辉丶8 天前
TensorFlow深度学习实战(29)——自监督学习(Self-Supervised Learning)
深度学习·tensorflow·自监督学习
斯~内克9 天前
CSS包含块与百分比取值机制完全指南
前端·css·tensorflow
盛夏绽放11 天前
原生CSS vs LESS:样式表语言的进化之旅
css·tensorflow·less
一年春又来11 天前
AI-03a1.Python深度学习-Tensorflow和Keras入门
人工智能·深度学习·tensorflow
盼小辉丶11 天前
TensorFlow深度学习实战(28)——扩散模型(Diffusion Model)
深度学习·tensorflow·生成模型
程序员秘密基地12 天前
基于html,css,jquery,django,lstm,cnn,tensorflow,bert,推荐算法,mysql数据库
python·cnn·tensorflow·lstm·推荐算法