0
私はtensorflowフレームワークを使用するC++プログラムを作成しようとしています。今私は重みにアクセスし、それをファイルに書き込もうとしています。私は以下に示すようにtensor_contentに記憶される重みにアクセスすることができません通常、ウェイトやバイアスを含む「tensor_content」を取得するには?
int node_count = graph_def.node_size();
for (int i = 0; i < node_count; i++)
{
auto n = graph_def.node(i);
cout<<"Names : "<< n.name() <<endl;
}
、
node {
name: "Weight"
op: "Const"
attr {
key: "dtype"
value {
type: DT_FLOAT
}
}
attr {
key: "value"
value {
tensor {
dtype: DT_FLOAT
tensor_shape {
dim {
size: 8
}
dim {
size: 2
}
}
tensor_content: "\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377\000\000\300\377"
}
}
}
}
ありがとう予め、以下のコードによってノードの名前にアクセスすることができる午前。