caffe 打印出Forward 函数输入输出的shape

void MyLossLayer<Ftype, Btype>::Forward_cpu(const vector<Blob*>& bottom,
		const vector<Blob*>& top) {

	//	bottom[0]: "depth" 1x1x36x64
	//	bottom[1]: "data" for loss reshape
	//	bottom[2]: "label"

	LOG(INFO)<<"=====>>>>>MyLossLayer";
	for(int i=0;i<bottom.size();i++)
	{
		LOG(INFO)<<"bottom["<<i<<"]="<<bottom[i]->shape_string();
	}
	for(int i=0;i<top.size();i++)
	{
		LOG(INFO)<<"top["<<i<<"]="<<top[i]->shape_string();
	}
...
//bottom[0]=14 1 48 144 (96768)  conv_depth_1x1
//bottom[1]=14 3 192 576 (4644864)  data
// bottom[2]=1 1 84 35 (2940)  label
// top[0]=(1)
posted @ 2023-01-04 14:15  无左无右  阅读(17)  评论(0编辑  收藏  举报