407/20 = 20
301/20 = 15
360/20 = 18
20x15x18 = 5400
I am using conv3d. a ct screening is not a 2 dimensional image it is a 3 dimensional voxel space. (nifti/dicom)
But as far as i can see x in your example is 3 dimensional(technically 4). So the problem is perhaps that you are only striding along 2 axis and not 3 ?
Only guessing and perhaps I am the one miss calculating.