diff --git a/tf2onnx/onnx_opset/generator.py b/tf2onnx/onnx_opset/generator.py index 0b59dca6b..f6e0409cb 100644 --- a/tf2onnx/onnx_opset/generator.py +++ b/tf2onnx/onnx_opset/generator.py @@ -60,8 +60,8 @@ def version_1(cls, ctx, node, **kwargs): # in the rewriter does not trigger. grappler will send the random uniform # with shape as input so we need to pickup the input here and if the shape is # const we make it an attribute. - seed = node.get_attr("seed") - node.set_attr("seed", float(seed.f)) + seed = node.get_attr("seed2") + node.set_attr("seed", float(seed.i)) utils.make_sure(node.inputs[0].is_const(), "%s node with non-const shape requires opset >= 9", node.type) shape = node.inputs[0].get_tensor_value() ctx.remove_input(node, node.input[0], 0) @@ -88,8 +88,8 @@ def version_9(cls, ctx, node, **kwargs): if node.inputs[0].is_const(): cls.version_1(ctx, node, **kwargs) else: - seed = node.get_attr("seed") - node.set_attr("seed", float(seed.f)) + seed = node.get_attr("seed2") + node.set_attr("seed", float(seed.i)) cast_node = ctx.make_node("Cast", [node.input[0]], attr={'to': onnx_pb.TensorProto.INT64}) const_node = ctx.make_node("ConstantOfShape", cast_node.output) inputs = node.input.copy()