Hi, I am new to caffe2. I built Inception v3 according to this website: https://dgschwend.github.io/netscope/#/preset/inceptionv3 1 , and I used “brew” to help me build the model, but I encountered some problems while running it. The problem is:
RuntimeError: [enforce fail at pool_op.h:27] pads_[i] < kernel_[i] && pads_[i + kernel_.size()] < kernel_[i]. Pad should be smaller than kernel.
I thought there are some problems with parameters. This is how I establish pool layer:
mixed_1_tower_2_AVG_pool = brew.average_pool ( model, mixed_tower_chconcat, ‘mixed_1_tower_2_AVG_pool’, kernel=3, pad=1, stride=1)
This is how I establish conv layer:
mixed_4_tower_conv_1_conv2d = brew.conv (model, mixed_4_tower_conv_conv2d_relu, ‘mixed_4_tower_conv_1_conv2d’, dim_in=128, dim_out=128, kernel=[1,7], pad=[0,3], stride=1)
kernel=[1,7] <<< “1” means “kernel width= 1”, “7” means “kernel height= 7”.
pad[0,3]<<<“0” means “pad width=0”, “3” means “pad height”=3.
I suspect that my code for concat layer and flatten layer may have some problem,
need some help for checking my code as shown below.
mixed_2_chconcat =brew.concat(model,[mixed_2_conv_conv2d_relu,mixed_2_tower_conv_1_conv2d_relu,mixed_2_tower_conv_b2_conv2d_relu,mixed_2_tower_2_conv_conv2d_relu],‘mixed_2_chconcat’)
flatten =model.Flatten(global_pool,‘flatten’)
I’d checked the value of pad is always smaller than the value of kernel in my Inception v3 file, but the problem still occurred.
How should I set the parameter? Is there any problem with my code?