查看Tensorflow SavedModel模型信息(转)

当我们拿到别人提供的pb模型时,我们很可能不清楚inputs所需的参数,可以使用以下方法来查看模型信息:

找到你的tensorflow安装位置,依次定位到以下目录:
tensorflow_core/python/tools
执行如下命令:
python saved_model_cli.py show --dir 模型路径 --all
之后可以得到如下信息:

复制代码
signature_def['serving_default']:
  The given SavedModel SignatureDef contains the following input(s):
    inputs['image_shape'] tensor_info:
        dtype: DT_FLOAT
        shape: (2)
        name: Placeholder_366:0
    inputs['input_image'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, -1, -1, 3)
        name: input_1:0
  The given SavedModel SignatureDef contains the following output(s):
    outputs['concat_11/concat:0'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1, 4)
        name: concat_11/concat:0
    outputs['concat_12/concat:0'] tensor_info:
        dtype: DT_FLOAT
        shape: (-1)
        name: concat_12/concat:0
    outputs['concat_13/concat:0'] tensor_info:
        dtype: DT_INT32
        shape: (-1)
        name: concat_13/concat:0
  Method name is: tensorflow/serving/predict
复制代码

转自:https://blog.csdn.net/github_34790294/article/details/103725850

posted @   鸭子船长  阅读(284)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示