Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.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
Machine learning 如何通过Pycaffe获得图层的输出形状_Machine Learning_Neural Network_Deep Learning_Caffe_Pycaffe - Fatal编程技术网

Machine learning 如何通过Pycaffe获得图层的输出形状

Machine learning 如何通过Pycaffe获得图层的输出形状,machine-learning,neural-network,deep-learning,caffe,pycaffe,Machine Learning,Neural Network,Deep Learning,Caffe,Pycaffe,标题已经包含了一个完整的问题:如何使用Pycaffe获得Caffe模型给定层的输出形状 我有一个caffe.Net()对象,现在我需要模型中特定层的输出形状。给定层名称,可以通过以下方式获取其索引: l_idx = list(net._layer_names).index(my_layer_name) 一旦您有了l_idx,您就可以得到它的输出(也称为“top”s): 对于每个“top”,您都可以获得信息 for tn in tops: print "output name {} has

标题已经包含了一个完整的问题:如何使用Pycaffe获得Caffe模型给定层的输出形状


我有一个
caffe.Net()
对象,现在我需要模型中特定层的输出形状。

给定层名称,可以通过以下方式获取其索引:

l_idx = list(net._layer_names).index(my_layer_name)
一旦您有了
l_idx
,您就可以得到它的输出(也称为
“top”
s):

对于每个
“top”
,您都可以获得信息

for tn in tops:
  print "output name {} has shape {}".format(tn, net.blobs[tn].data.shape)
可以找到关于如何通过pycaffe接口访问网络结构的更详细示例

for tn in tops:
  print "output name {} has shape {}".format(tn, net.blobs[tn].data.shape)