【发布时间】:2017-05-23 03:39:15
【问题描述】:
类似于How to access values in protos in TensorFlow?,但不适合这种情况。
我在TensorProto 中看到了bytes tensor_content 属性。我正在尝试通过以下方式获取有关节点的信息:
for node in tf.get_default_graph().as_graph_def().node:
node.attr['value'].tensor.tensor_content # decode these bytes
关于信息,节点的打印看起来像这样:
name: "conv2d/convolution/Shape"
op: "Const"
device: "/device:GPU:0"
attr {
key: "dtype"
value {
type: DT_INT32
}
}
attr {
key: "value"
value {
tensor {
dtype: DT_INT32
tensor_shape {
dim {
size: 4
}
}
tensor_content: "\003\000\000\000\003\000\000\000\001\000\000\000 \000\000\000"
}
}
}
【问题讨论】:
标签: tensorflow