卷积问题在Caffe

我有存储在HDF5文件中的96×96像素的灰度图像。我试图使用Caffe进行多输出回归,但是卷积操作无法正常工作。这里到底是什么问题?为什么卷积不工作?

I0122 17:18:39.474860  5074 net.cpp:67] Creating Layer fkpI0122 17:18:39.474889  5074 net.cpp:356] fkp -> dataI0122 17:18:39.474930  5074 net.cpp:356] fkp -> labelI0122 17:18:39.474967  5074 net.cpp:96] Setting up fkpI0122 17:18:39.474987  5074 hdf5_data_layer.cpp:57] Loading filename from train.txtI0122 17:18:39.475103  5074 hdf5_data_layer.cpp:69] Number of files: 1I0122 17:18:39.475131  5074 hdf5_data_layer.cpp:29] Loading HDF5 filefacialkp-train.hd5I0122 17:18:40.337786  5074 hdf5_data_layer.cpp:49] Successully loaded 4934 rowsI0122 17:18:40.337862  5074 hdf5_data_layer.cpp:81] output data size: 100,9216,1,1I0122 17:18:40.337906  5074 net.cpp:103] Top shape: 100 9216 1 1 (921600)I0122 17:18:40.337929  5074 net.cpp:103] Top shape: 100 30 1 1 (3000)I0122 17:18:40.337971  5074 net.cpp:67] Creating Layer conv1I0122 17:18:40.338001  5074 net.cpp:394] conv1 <- dataI0122 17:18:40.338069  5074 net.cpp:356] conv1 -> conv1I0122 17:18:40.338109  5074 net.cpp:96] Setting up conv1F0122 17:18:40.599761  5074 blob.cpp:13] Check failed: height >= 0 (-3 vs. 0) 

我的prototxt层文件如下

name: "LogReg"layers {  top: "data"  top: "label"  name: "fkp"  type: HDF5_DATA  hdf5_data_param {    source: "train.txt"    batch_size: 100  }  include {    phase: TRAIN  }}layers {  bottom: "data"  top: "conv1"  name: "conv1"  type: CONVOLUTION  blobs_lr: 1  blobs_lr: 2  convolution_param {    num_output: 64    kernel_size: 5    stride: 1    weight_filler {      type: "xavier"    }    bias_filler {      type: "constant"    }  }}layers {  bottom: "conv1"  top: "pool1"  name: "pool1"  type: POOLING  pooling_param {    pool: MAX    kernel_size: 2    stride: 2  }}layers {  bottom: "pool1"  top: "conv2"  name: "conv2"  type: CONVOLUTION  blobs_lr: 1  blobs_lr: 2  convolution_param {    num_output: 256    kernel_size: 5    stride: 1    weight_filler {      type: "xavier"    }    bias_filler {      type: "constant"    }  }}layers {  bottom: "conv2"  top: "pool2"  name: "pool2"  type: POOLING  pooling_param {    pool: MAX    kernel_size: 2    stride: 2  }}layers {  bottom: "pool2"  top: "ip1"  name: "ip1"  type: INNER_PRODUCT  blobs_lr: 1  blobs_lr: 2  inner_product_param {    num_output: 500    weight_filler {      type: "xavier"    }    bias_filler {      type: "constant"    }  }}layers {  bottom: "ip1"  top: "ip1"  name: "relu1"  type: RELU}layers {  bottom: "ip1"  top: "ip2"  name: "ip2"  type: INNER_PRODUCT  blobs_lr: 1  blobs_lr: 2  inner_product_param {    num_output: 30    weight_filler {      type: "xavier"    }    bias_filler {      type: "constant"    }  }}layers {  bottom: "ip2"  bottom: "label"  top: "loss"  name: "loss"  type: EUCLIDEAN_LOSS}

回答:

这些行

I0122 17:18:40.337906  5074 net.cpp:103] Top shape: 100 9216 1 1 (921600)I0122 17:18:40.337929  5074 net.cpp:103] Top shape: 100 30 1 1 (3000)

表明你的输入数据形状不正确。对于100批次的96×96灰度图像,形状应该是:100 1 96 96。尝试更改这一点。(我的猜测是,对于形状:N C H W,其中N是批次数量,C是通道数,H是高度,W是宽度)

Related Posts

L1-L2正则化的不同系数

我想对网络的权重同时应用L1和L2正则化。然而,我找不…

使用scikit-learn的无监督方法将列表分类成不同组别,有没有办法?

我有一系列实例,每个实例都有一份列表,代表它所遵循的不…

f1_score metric in lightgbm

我想使用自定义指标f1_score来训练一个lgb模型…

通过相关系数矩阵进行特征选择

我在测试不同的算法时,如逻辑回归、高斯朴素贝叶斯、随机…

可以将机器学习库用于流式输入和输出吗?

已关闭。此问题需要更加聚焦。目前不接受回答。 想要改进…

在TensorFlow中,queue.dequeue_up_to()方法的用途是什么?

我对这个方法感到非常困惑,特别是当我发现这个令人费解的…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注