CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Error with strides>1 in Convolution3D

Open roger77 opened this issue 9 years ago • 9 comments

I'm trying to increase the strides in the conv3D_UCF11 example. It works without problem with strides=1, but gives error if I either increase the size or add a 3D tuple as in: Convolution3D((3,3,3), 64, pad=True,strides=3), Convolution3D((3,3,3), 64, pad=True,strides=(3,3,3)),

they both leads to the following errors: ValueError: Convolution operation requires that kernel dim 3 <= input dim 1.

roger77 avatar Mar 31 '17 21:03 roger77

interestingly Convolution3D((3,3,3), 64, pad=True, strides=(1,3,3)), works just fine

roger77 avatar Mar 31 '17 22:03 roger77

Does your input only has 1 depth channel?

cha-zhang avatar Apr 01 '17 23:04 cha-zhang

This problem is present in the Conv3D_UCF11.py of cntk/Example/Video/GettingStarted/Python. Just add the strides=(3,3,3) to the first Convolution3D layer in the model. This should work since the channel depth is 3.

roger77 avatar Apr 02 '17 00:04 roger77

What version of CNTK are you using?

ebarsoumMS avatar Apr 02 '17 04:04 ebarsoumMS

2.0.beta15.0

roger77 avatar Apr 02 '17 04:04 roger77

Hi Roger77,

strides(3,3,3) works if you reduce the range from 3 to 1. The reason that it doesn't work in your case, is that in this network when you start with stride of 3, you will run out of dimension at the end of the network.

Thanks, Emad

ebarsoumMS avatar Apr 03 '17 20:04 ebarsoumMS

Emad,

Thanks a lot for your answer. Do you know how can I find out which strides are compatible with the network?

Roger

roger77 avatar Apr 03 '17 20:04 roger77

Hi Roger,

You can set the log to be very verbose, by calling "set_computation_network_trace_level(1000)", or you can manually compute the input and output dimension using formula from http://cs231n.github.io/convolutional-networks/

Each layer reduce the input dimension, however, you can't reduce below 1.

Thanks, Emad

ebarsoumMS avatar Apr 03 '17 20:04 ebarsoumMS

Sorry set the trace level to 1, 1000 will create a huge log file.

ebarsoumMS avatar Apr 03 '17 20:04 ebarsoumMS