【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中调用会用到。
相关推荐
B站_计算机毕业设计之家19 小时前
计算机毕业设计:Python股市行情可视化与深度学习预测系统 Flask框架 TensorFlow LSTM 数据分析 可视化 大数据 大模型(建议收藏)✅
人工智能·python·深度学习·django·flask·tensorflow·课程设计
独隅2 天前
PyTorch模型转TensorFlow Lite的Android部署全流程指南
android·pytorch·tensorflow
流年残碎念2 天前
用TensorFlow Lite在树莓派上部署目标检测
人工智能·目标检测·tensorflow
独隅6 天前
PyTorch模型转换为TensorFlow Lite实现 iOS 部署的全面指南
pytorch·ios·tensorflow
山海AI手册9 天前
028、边缘AI与嵌入式部署:TensorFlow Lite/PyTorch Mobile实战手记
人工智能·pytorch·tensorflow
码云数智-大飞10 天前
CSS 优先级详解:告别样式冲突,掌控网页“层叠”艺术
人工智能·python·tensorflow
奔跑的卡卡10 天前
Web开发与AI融合-第二篇:TensorFlow.js实战:在浏览器中运行AI模型
前端·人工智能·tensorflow
独隅10 天前
TensorFlow 图像分类完整代码模板与深度解析
人工智能·分类·tensorflow
云程笔记11 天前
004.环境搭建基础篇:Python、CUDA、cuDNN、PyTorch/TensorFlow安装与版本兼容性踩坑
pytorch·python·tensorflow
万粉变现经纪人12 天前
如何解决 pip install tensorflow-gpu 报错 未检测到 CUDA 驱动 问题
人工智能·python·深度学习·aigc·tensorflow·bug·pip