【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中调用会用到。
相关推荐
YelloooBlue6 分钟前
深度学习 SOP: conda通过命令快速构建指定版本tensorflow gpu环境。
深度学习·conda·tensorflow
翱翔的苍鹰3 天前
多Agent智能体系统设计思路
java·python·深度学习·神经网络·机器学习·tensorflow
地球没有花5 天前
调整warmup的batch优化tensorflow serving P99耗时毛刺
人工智能·python·tensorflow
莫非王土也非王臣5 天前
网页端的TensorFlow开发实践
人工智能·python·tensorflow
却道天凉_好个秋6 天前
Tensorflow数据增强(一):图片的导入与显示
人工智能·python·tensorflow
技术小黑6 天前
TensorFlow学习系列03 | 实现天气识别
人工智能·cnn·tensorflow
赋创小助手6 天前
NVIDIA H100与GH200选型指南:AI与HPC负载的硬件适配方案
服务器·人工智能·深度学习·神经网络·语言模型·自然语言处理·tensorflow
UR的出不克6 天前
【Python实战】基于Flask+TensorFlow的网易云音乐数据分析系统:从数据爬取到情感分析的全流程实现
python·flask·tensorflow
抠头专注python环境配置7 天前
解决“No module named ‘tensorflow‘”报错:从导入失败到环境配置成功
人工智能·windows·python·tensorflow·neo4j
hahahahanhanhan7 天前
Tensorflow使用GPU(cuda和cudnn和tensorflow下载)
人工智能·python·tensorflow·gpu