Skip to content

Commit 3f0f987

Browse files
committed
Fix issue with model esrgan-tf2_1
1 parent 0a11159 commit 3f0f987

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

tests/run_pretrained_models.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,22 @@ benchtf-gru:
115115
##
116116
## standard image nets
117117
##
118+
119+
esrgan-tf2:
120+
url: https://tfhub.dev/captain-pool/esrgan-tf2/1/esrgan-tf2_1.tar.gz
121+
model: fixme
122+
input_get: get_beach
123+
inputs:
124+
"input:0": [1, 416, 416, 3]
125+
outputs:
126+
- Identity:0
127+
118128
inception_v3_slim:
119129
url: https://storage.googleapis.com/download.tensorflow.org/models/inception_v3_2016_08_28_frozen.pb.tar.gz
120130
model: inception_v3_2016_08_28_frozen.pb
121131
input_get: get_beach
122132
inputs:
123-
"input:0": [1, 299, 299, 3]
133+
"input_0:0": [1, 299, 299, 3]
124134
outputs:
125135
- InceptionV3/Predictions/Softmax:0
126136
rtol: 0.02

tf2onnx/optimizer/transpose_optimizer.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,10 @@ def _reducemean_handler(self, trans, node):
648648
def _slice_handler(self, trans, node):
649649
axes = None
650650
if self._g.opset < 10:
651-
axes = node.get_attr("axes").ints
651+
axes_values = node.get_attr("axes")
652+
if not axes_values:
653+
return False
654+
axes = axes_values.ints
652655
if axes == [0, 1, 2, 3]:
653656
node.set_attr("axes", NCHW_TO_NHWC)
654657
return self._switch_transpose_and_node(node, trans)

0 commit comments

Comments
 (0)