Skip to content

Commit 70b13e1

Browse files
authored
Fix prerprocess_input for mobilenets (#56) (#98)
* Fix `prerprocess_input` for mobilenets (#56) * Fix `preprocess_input` for mobilenets (#56)
1 parent 75075da commit 70b13e1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

segmentation_models/backbones/mobilenet.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def preprocess_input(x, **kwargs):
6969
# Returns
7070
Preprocessed array.
7171
"""
72+
kwargs['backend'] = backend
7273
return imagenet_utils.preprocess_input(x, mode='tf', **kwargs)
7374

7475

segmentation_models/backbones/mobilenetv2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def preprocess_input(x, **kwargs):
8989
# Returns
9090
Preprocessed array.
9191
"""
92+
kwargs['backend'] = backend
9293
return imagenet_utils.preprocess_input(x, mode='tf', **kwargs)
9394

9495

@@ -467,4 +468,4 @@ def _inverted_res_block(inputs, expansion, stride, alpha, filters, block_id):
467468

468469
if in_channels == pointwise_filters and stride == 1:
469470
return layers.Add(name=prefix + 'add')([inputs, x])
470-
return x
471+
return x

0 commit comments

Comments
 (0)