Minor error message fix.

PiperOrigin-RevId: 346856975
Change-Id: Ic1a9cec0b0f2cd1776fa5307f9a37edc5d3ef84a
This commit is contained in:
Ruoxin Sang 2020-12-10 13:47:09 -08:00 committed by TensorFlower Gardener
parent e7eca6bc4d
commit 03dd7a1891

View File

@ -781,8 +781,9 @@ def _write_object_proto(obj, proto, asset_file_def_index, function_name_map):
elif resource_variable_ops.is_resource_variable(obj):
proto.variable.SetInParent()
if not obj.name.endswith(":0"):
raise ValueError("Cowardly refusing to save variable %s because of"
" unexpected suffix which won't be restored.")
raise ValueError("Cowardly refusing to save variable {} because of"
" unexpected suffix which won't be restored.".format(
obj.name))
proto.variable.name = meta_graph._op_name(obj.name) # pylint: disable=protected-access
proto.variable.trainable = obj.trainable
proto.variable.dtype = obj.dtype.as_datatype_enum