List of tensor names in graph in Tensorflow

后端 未结 6 1147
死守一世寂寞
死守一世寂寞 2020-11-28 21:04

The graph object in Tensorflow has a method called \"get_tensor_by_name(name)\". Is there anyway to get a list of valid tensor names?

If not, does anyone know the va

6条回答
  •  天命终不由人
    2020-11-28 21:28

    saved_model_cli is An alternative command line tool comes with TF that might be useful if your dealing with the "SavedModel" format. From the docs

    !saved_model_cli show --dir /tmp/mobilenet/1 --tag_set serve --all
    

    This output might be useful, something like:

    MetaGraphDef with tag-set: 'serve' contains the following SignatureDefs:
    
    signature_def['__saved_model_init_op']:
      The given SavedModel SignatureDef contains the following input(s):
      The given SavedModel SignatureDef contains the following output(s):
        outputs['__saved_model_init_op'] tensor_info:
            dtype: DT_INVALID
            shape: unknown_rank
            name: NoOp
      Method name is: 
    
    signature_def['serving_default']:
      The given SavedModel SignatureDef contains the following input(s):
        inputs['dense_input'] tensor_info:
            dtype: DT_FLOAT
            shape: (-1, 1280)
            name: serving_default_dense_input:0
      The given SavedModel SignatureDef contains the following output(s):
        outputs['dense_1'] tensor_info:
            dtype: DT_FLOAT
            shape: (-1, 1)
            name: StatefulPartitionedCall:0
      Method name is: tensorflow/serving/predict
    

提交回复
热议问题