Reputation: 1272
I have a RGB colour image, which i was trying to train using conv2d. As per CNN each filter should stride over all channels of input. But while following this rule in TF i got an error
InvalidArgumentError: Current implementation does not yet support strides in the batch and depth dimensions.
From this discussion, it seems TF supports only one increment along input channels in conv2d. So my question is
1. Is there any way i could stride over multiple channels in TF ?
2. will it be a correct procedure to use default stride(i.e 1) over RGB Image?
Upvotes: 3
Views: 1741
Reputation: 3763
In my opinion, it isn't useful to stride over batch or depth. Your stride should be something like [1,m,n,1].
First, let's start with batch, the 1st dimension. These are your samples, your images. Striding over your images would mean you'd just drop whole images from training or induction.
Second, depth the 4th dimension. Initially this is your RGB. Striding across RGB would mean that you'd just completely drop a whole color or two. That doesn't make sense. It would be massive information loss.
Third, the purpose of stride. Stride can useful when your image is an oversampling at the pixel level (not the color level) of what you are analyzing and you are okay with just tossing information. It is aggressive data destruction. It turns high definition images into medium definition, and medium definition into low.
You wouldn't want to destroy RBG channels (depth) or whole images (batch) even if you want to downsample your images (stride).
Upvotes: 6