Nima
Nima

Reputation: 433

caffe: can not change pad size of pooling layer

when changing pas size, I get this error. I tried different pad sizes, but I am getting similar errors. here is more details:

    layer {
  name: "Pooling1"
  type: "Pooling"
  bottom: "Convolution2"
  top: "Pooling1"
  pooling_param {
    pool: MAX
    kernel_h: 1
    kernel_w: 2
    stride_h: 1
    stride_w: 2
    pad_h: 0
    pad_w: 3
  }

This is the error:

...
Creating layer Convolution2
I0525 10:45:37.403520 20575 net.cpp:84] Creating Layer Convolution2
I0525 10:45:37.403524 20575 net.cpp:406] Convolution2 <- Concat1
I0525 10:45:37.403529 20575 net.cpp:380] Convolution2 -> Convolution2
I0525 10:45:37.403555 20575 net.cpp:122] Setting up Convolution2
I0525 10:45:37.403560 20575 net.cpp:129] Top shape: 1 16 1 4076 (65216)
I0525 10:45:37.403563 20575 net.cpp:137] Memory required for data: 3022080
I0525 10:45:37.403568 20575 layer_factory.hpp:77] Creating layer Pooling1
I0525 10:45:37.403571 20575 net.cpp:84] Creating Layer Pooling1
I0525 10:45:37.403575 20575 net.cpp:406] Pooling1 <- Convolution2
I0525 10:45:37.403581 20575 net.cpp:380] Pooling1 -> Pooling1
F0525 10:45:37.403594 20575 pooling_layer.cpp:74] Check failed: pad_w_ < kernel_w_ (3 vs. 2)

thanks in advance!

Upvotes: 1

Views: 60

Answers (1)

Shai
Shai

Reputation: 114786

The problem is very clear from the error message you get: you set your pad to be larger than the pooling kernel size. Reduce the pad and you should be okay

Upvotes: 1

Related Questions