Skip to content

Commit 8bffd4f

Browse files
authored
Merge pull request #21 from jiapei100/master
image_dim_ordering to image_data_format, Keras with Tensorflow backen…
2 parents 34d68b6 + b69658e commit 8bffd4f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

resnet_152.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ def resnet152_model(img_rows, img_cols, color_type=1, num_classes=None):
111111

112112
# Handle Dimension Ordering for different backends
113113
global bn_axis
114-
if K.image_dim_ordering() == 'tf':
114+
if K.image_data_format() == 'channels_last':
115115
bn_axis = 3
116116
img_input = Input(shape=(img_rows, img_cols, color_type), name='data')
117-
else:
117+
else: # Must be channels_first
118118
bn_axis = 1
119119
img_input = Input(shape=(color_type, img_rows, img_cols), name='data')
120120

@@ -147,7 +147,7 @@ def resnet152_model(img_rows, img_cols, color_type=1, num_classes=None):
147147

148148
model = Model(img_input, x_fc)
149149

150-
if K.image_dim_ordering() == 'th':
150+
if K.image_data_format() == 'channels_first':
151151
# Use pre-trained weights for Theano backend
152152
weights_path = 'models/resnet152_weights_th.h5'
153153
else:

0 commit comments

Comments
 (0)