提交 66f82a47 编写于 作者: C Channingss

fix bug of nearest opset11

上级 3f51c5ce
...@@ -29,7 +29,6 @@ class OpSet11(OpSet10): ...@@ -29,7 +29,6 @@ class OpSet11(OpSet10):
super(OpSet11, self).__init__() super(OpSet11, self).__init__()
def relu6(self, op, block): def relu6(self, op, block):
print('relu6')
min_name = self.get_name(op.type, 'min') min_name = self.get_name(op.type, 'min')
max_name = self.get_name(op.type, 'max') max_name = self.get_name(op.type, 'max')
min_node = self.make_constant_node(min_name, onnx_pb.TensorProto.FLOAT, min_node = self.make_constant_node(min_name, onnx_pb.TensorProto.FLOAT,
...@@ -43,7 +42,6 @@ class OpSet11(OpSet10): ...@@ -43,7 +42,6 @@ class OpSet11(OpSet10):
return [min_node, max_node, node] return [min_node, max_node, node]
def pad2d(self, op, block): def pad2d(self, op, block):
print('pad2d')
x_shape = block.var(op.input('X')[0]).shape x_shape = block.var(op.input('X')[0]).shape
paddings = op.attr('paddings') paddings = op.attr('paddings')
onnx_pads = [] onnx_pads = []
...@@ -71,7 +69,6 @@ class OpSet11(OpSet10): ...@@ -71,7 +69,6 @@ class OpSet11(OpSet10):
return [pads_node, constant_value_node, node] return [pads_node, constant_value_node, node]
def clip(self, op, block): def clip(self, op, block):
print('clip')
min_name = self.get_name(op.type, 'min') min_name = self.get_name(op.type, 'min')
max_name = self.get_name(op.type, 'max') max_name = self.get_name(op.type, 'max')
min_node = self.make_constant_node(min_name, onnx_pb.TensorProto.FLOAT, min_node = self.make_constant_node(min_name, onnx_pb.TensorProto.FLOAT,
...@@ -85,7 +82,6 @@ class OpSet11(OpSet10): ...@@ -85,7 +82,6 @@ class OpSet11(OpSet10):
return [min_node, max_node, node] return [min_node, max_node, node]
def bilinear_interp(self, op, block): def bilinear_interp(self, op, block):
print('bilinear')
input_names = op.input_names input_names = op.input_names
coordinate_transformation_mode = '' coordinate_transformation_mode = ''
align_corners = op.attr('align_corners') align_corners = op.attr('align_corners')
...@@ -205,7 +201,6 @@ class OpSet11(OpSet10): ...@@ -205,7 +201,6 @@ class OpSet11(OpSet10):
roi_node = self.make_constant_node(roi_name, onnx_pb.TensorProto.FLOAT, roi_node = self.make_constant_node(roi_name, onnx_pb.TensorProto.FLOAT,
[1, 1, 1, 1, 1, 1, 1, 1]) [1, 1, 1, 1, 1, 1, 1, 1])
if 'OutSize' in input_names and len(op.input('OutSize')) > 0: if 'OutSize' in input_names and len(op.input('OutSize')) > 0:
print('0000')
node = helper.make_node( node = helper.make_node(
'Resize', 'Resize',
inputs=[op.input('X')[0], roi_name, op.input('OutSize')[0]], inputs=[op.input('X')[0], roi_name, op.input('OutSize')[0]],
...@@ -213,7 +208,6 @@ class OpSet11(OpSet10): ...@@ -213,7 +208,6 @@ class OpSet11(OpSet10):
mode='nearest', mode='nearest',
coordinate_transformation_mode=coordinate_transformation_mode) coordinate_transformation_mode=coordinate_transformation_mode)
elif 'Scale' in input_names and len(op.input('Scale')) > 0: elif 'Scale' in input_names and len(op.input('Scale')) > 0:
print('1111')
node = helper.make_node( node = helper.make_node(
'Resize', 'Resize',
inputs=[op.input('X')[0], roi_name, op.input('Scale')[0]], inputs=[op.input('X')[0], roi_name, op.input('Scale')[0]],
...@@ -221,7 +215,6 @@ class OpSet11(OpSet10): ...@@ -221,7 +215,6 @@ class OpSet11(OpSet10):
mode='nearest', mode='nearest',
coordinate_transformation_mode=coordinate_transformation_mode) coordinate_transformation_mode=coordinate_transformation_mode)
else: else:
print('2222')
out_shape = [op.attr('out_h'), op.attr('out_w')] out_shape = [op.attr('out_h'), op.attr('out_w')]
scale = op.attr('scale') scale = op.attr('scale')
if out_shape.count(-1) > 0: if out_shape.count(-1) > 0:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册