Skip to content

Commit 1365fb1

Browse files
committed
fix mobilnetv2
1 parent 42ade07 commit 1365fb1

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

tests/run_pretrained_models.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ googlenet_v4_slim:
156156
rtol: 0.1
157157

158158
mobilenet_v2_1.4_224:
159-
# fails because of input[1] in squeeze is 0 instead of 1
160-
disabled: true
161159
url: https://storage.googleapis.com/mobilenet_v2/checkpoints/mobilenet_v2_1.4_224.tgz
162160
model: mobilenet_v2_1.4_224_frozen.pb
163161
input_get: get_beach

tf2onnx/onnx_opset/nn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def add_padding(ctx, node, kernel_shape, strides, dilations=None, spatial=2):
148148
input_shape = spatial_map(input_shape, constants.NHWC_TO_NCHW)
149149
output_shape = spatial_map(output_shape, constants.NHWC_TO_NCHW)
150150
# calculate pads
151-
if any(input_shape[i + 2] == -1 for i in range(spatial)):
151+
if any(input_shape[i + 2] == -1 or output_shape[i + 2] == -1 for i in range(spatial)):
152152
log.debug("node %s has unknown dim %d for pads calculation, fallback to auto_pad",
153153
node.name, input_shape)
154154
node.set_attr("auto_pad", "SAME_UPPER")

0 commit comments

Comments
 (0)