ENCP / CNNdroid

Open Source Library for GPU-Accelerated Execution of Trained Deep Convolutional Neural Networks on Android
MIT License
539 stars 181 forks source link

output_length different with caffe #4

Open jay2002 opened 7 years ago

jay2002 commented 7 years ago

I noticed that in CNNdroid's implementation, the output width and height of conv layer are calculated as:

        int h_o = (int) (Math.ceil((h_i + 2 * pad[0] - h_k) / ((float) (stride[0]))) + 1);
        int w_o = (int) (Math.ceil((w_i + 2 * pad[1] - w_k) / ((float) (stride[1]))) + 1);

But in caffe, they are calculated by floor. Is it a bug?

ghost commented 7 years ago

That is true. I noticed that too. After correcting this, the exported android app runs as it should have.