Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/129.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Caffe C++;-访问其他层中的数据 我试图用CaseC++来访问各个层次。但是,我无法获取任何数据: net_.Forward(); std::vector<std::string> layerNames = net_.layer_names(); for(int i=0; i<layerNames.size(); i++){ cout << layerNames[i] << endl; std::vector<boost::shared_ptr<caffe::Blob<float> > >& layer = net_.layer_by_name(layerNames[i])->blobs(); cout << layer.size() << endl; } net.Forward(); std::vector layerNames=网络层名称(); 对于(int i=0;i_C++_Neural Network_Deep Learning_Caffe - Fatal编程技术网

Caffe C++;-访问其他层中的数据 我试图用CaseC++来访问各个层次。但是,我无法获取任何数据: net_.Forward(); std::vector<std::string> layerNames = net_.layer_names(); for(int i=0; i<layerNames.size(); i++){ cout << layerNames[i] << endl; std::vector<boost::shared_ptr<caffe::Blob<float> > >& layer = net_.layer_by_name(layerNames[i])->blobs(); cout << layer.size() << endl; } net.Forward(); std::vector layerNames=网络层名称(); 对于(int i=0;i

Caffe C++;-访问其他层中的数据 我试图用CaseC++来访问各个层次。但是,我无法获取任何数据: net_.Forward(); std::vector<std::string> layerNames = net_.layer_names(); for(int i=0; i<layerNames.size(); i++){ cout << layerNames[i] << endl; std::vector<boost::shared_ptr<caffe::Blob<float> > >& layer = net_.layer_by_name(layerNames[i])->blobs(); cout << layer.size() << endl; } net.Forward(); std::vector layerNames=网络层名称(); 对于(int i=0;i,c++,neural-network,deep-learning,caffe,C++,Neural Network,Deep Learning,Caffe,您的代码检查层的blob:这些是网络的内部参数(可训练参数)。数据层没有内部参数,因此您得到的blob的大小为零 另一方面,如果你想检查网络的数据块(即输入和响应),你应该查看net.blob\u names()和net.blob()我想你得到了层的内部参数。“数据”层没有内部参数,因此此层的大小为零。其他层的大小是否为非零(“Conv”和“InnrrProduct”层)?您应该查看net.blobs()和net.blob\u names()相反。这似乎有效!您可以将其作为答案发布。请查看我的答

您的代码检查层的blob:这些是网络的内部参数(可训练参数)。
数据层没有内部参数,因此您得到的blob的
大小为零


另一方面,如果你想检查网络的数据块(即输入和响应),你应该查看
net.blob\u names()
net.blob()

我想你得到了层的内部参数。
“数据”
层没有内部参数,因此此层的大小为零。其他层的大小是否为非零(
“Conv”
“InnrrProduct”
层)?您应该查看
net.blobs()
net.blob\u names()
相反。这似乎有效!您可以将其作为答案发布。请查看我的答案