0

I'm newbie with Tensorflow and Keras, and I'm migrating the following code:

Convolution2D(64, 5, 5, activation='relu', border_mode='same', dim_ordering='tf', name='conv1_1')(inputs)

The interpreter suggest me this code:

Conv2D(64, (5, 5), activation="relu", name="conv1_1", padding="same", data_format="channels_last")

My question is:

Is dim_ordering='tf' the same as data_format="channels_last"?

VansFannel
  • 45,055
  • 107
  • 359
  • 626

2 Answers2

2

Yes, dim_ordering='tf' is equal to data_format="channels_last", which is also the default, so most of the times you might simply ignore this parameter.

This site seems to store old Keras documentation pages where you can confirm this: http://faroit.com/keras-docs/1.0.8/layers/convolutional/#convolution2d

Daniel Möller
  • 84,878
  • 18
  • 192
  • 214
0

For the new api, you'll have to convert dim_ordering to data_format and the corresponding values are tf -> channels_last or th -> channels_first. So

# for dim_ordering = 'tf'
data_format =  'channels_last'


# for dim_ordering = 'th'
data_format =  'channels_first'
Ziku
  • 431
  • 6
  • 9