caffe icon indicating copy to clipboard operation
caffe copied to clipboard

support "round_mode" in pooling layer with MKLDNN engine

Open sysuxiaoming opened this issue 5 years ago • 2 comments

Hi all,

I have a model which has a pooling layer with floor round mode. but i found that intel caffe do not support pooling parameter "round_mode" in pooling layer. it default use ceil round mode.

when i try to change the code in caffe/src/caffe/layers/mkl_pooling_layer.cpp image

i get the follow error image

how can we use model with floor round mode pooling layer in intel caffe with MKLDNN or MKL2017 engine?

sysuxiaoming avatar Apr 19 '19 08:04 sysuxiaoming

pls don't touch mkl_xxx layer, it's deprecated.

ftian1 avatar Apr 19 '19 08:04 ftian1

hi ftian1, thanks for your reply.

i try mkdnn firstly, but it have a more strange result. After i init network, the first infer pass is correct, but the following infer pass no matter what i input, it output the same result as the first infer pass.

when i debug this question i remove the round mode, so the question seem has no relatation with the round mode of pooling layer.

with the same code and the same model, when i use caffe or mkl2017 engine, it work fine. but when i use mkldnn engine it has strange result.

p.s. the model i use is densenet121 and batch size is 1.

As for the pooling layer round-mode question, i had try to modify caffe/src/caffe/layers/mkldnn_pooling_layer.cpp image

i work correct in the first infer pass. but no matter what i input, the follow infer pass have the same result as the first pass.

sysuxiaoming avatar Apr 19 '19 09:04 sysuxiaoming