【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中调用会用到。
相关推荐
摸鱼仙人~20 小时前
TensorFlow/Keras实现知识蒸馏案例
人工智能·tensorflow·keras
浊酒南街20 小时前
TensorFlow之微分求导
人工智能·python·tensorflow
kyle~2 天前
深度学习框架---TensorFlow概览
人工智能·深度学习·tensorflow
盼小辉丶2 天前
TensorFlow深度学习实战(16)——注意力机制详解
深度学习·tensorflow·注意力机制
浊酒南街4 天前
TensorFlow中数据集的创建
人工智能·tensorflow
满怀10155 天前
【人工智能核心技术全景解读】从机器学习到深度学习实战
人工智能·python·深度学习·机器学习·tensorflow
李昊哲小课5 天前
tensorflow-cpu
大数据·人工智能·python·深度学习·数据分析·tensorflow
Blossom.1188 天前
使用Python和TensorFlow实现图像分类的人工智能应用
开发语言·人工智能·python·深度学习·安全·机器学习·tensorflow
盼小辉丶8 天前
TensorFlow深度学习实战(15)——编码器-解码器架构
人工智能·深度学习·tensorflow
大G哥10 天前
用 Go 和 TensorFlow 实现图像验证码识别系统
开发语言·后端·golang·tensorflow·neo4j