0

我有存储在 HDF5 文件中的灰度格式的 96x96 像素图像。我正在尝试使用 caffe 进行多输出回归,但是卷积不起作用。这里到底有什么问题?为什么卷积不起作用?

I0122 17:18:39.474860  5074 net.cpp:67] Creating Layer fkp
I0122 17:18:39.474889  5074 net.cpp:356] fkp -> data
I0122 17:18:39.474930  5074 net.cpp:356] fkp -> label
I0122 17:18:39.474967  5074 net.cpp:96] Setting up fkp
I0122 17:18:39.474987  5074 hdf5_data_layer.cpp:57] Loading filename from train.txt
I0122 17:18:39.475103  5074 hdf5_data_layer.cpp:69] Number of files: 1
I0122 17:18:39.475131  5074 hdf5_data_layer.cpp:29] Loading HDF5 filefacialkp-train.hd5
I0122 17:18:40.337786  5074 hdf5_data_layer.cpp:49] Successully loaded 4934 rows
I0122 17:18:40.337862  5074 hdf5_data_layer.cpp:81] output data size: 100,9216,1,1
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)
I0122 17:18:40.337971  5074 net.cpp:67] Creating Layer conv1
I0122 17:18:40.338001  5074 net.cpp:394] conv1 <- data
I0122 17:18:40.338069  5074 net.cpp:356] conv1 -> conv1
I0122 17:18:40.338109  5074 net.cpp:96] Setting up conv1
F0122 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
}
4

1 回答 1

3

线条

I0122 17:18:40.337906 5074 net.cpp:103] 顶部形状:100 9216 1 1 (921600)
I0122 17:18:40.337929 5074 net.cpp:103] 顶部形状:100 30 1 1 (3000)

建议您的输入数据的形状不正确。对于 100 批 96x96 灰度图像的输入,形状应为:100 1 96 96。尝试更改此设置。(我的猜测是形状:NCHW,其中 N 个批次,c 个通道,h 高度,w 重量)

于 2015-02-16T14:58:48.230 回答