1
votes

I have a question about the 4D tensor on keras about Convolution2D Layers.

The Keras doc says: 4D tensor with shape: (samples, channels, rows, cols) if dim_ordering='th' or 4D tensor with shape: (samples, rows, cols, channels) if dim_ordering='tf'.

I use 'tf', how about my input? When I use (samples, channels, rows, cols), it is ok, but when I use (samples, rows, cols, channels) as input, it has some problems.

1
Welcome to Stack Overflow! In order to help us answer your question, please share a little more information about the problems you encountered when using the "tf" ordering. - mrry
I got the answer from the author of keras on github. - gkleeshh
Can you please share his answer then? You can put it as an answer here to your own question. That will help others who face similar problems. - pyan

1 Answers

0
votes

Keras assumes that if you are using tensorflow, you are going with (samples, channels, rows, cols)