提交 aa509693 编写于 作者: S Sukriti Ramesh 提交者: TensorFlower Gardener

Remove SavedModel dependency on manifest proto.

Change: 133885459
上级 0ae4e2ec
......@@ -21,7 +21,6 @@ py_library(
srcs_version = "PY2AND3",
deps = [
"//tensorflow:tensorflow_py",
"//tensorflow/contrib/session_bundle:manifest_proto_py",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:framework_for_generated_wrappers",
"//tensorflow/python:platform",
......@@ -56,7 +55,6 @@ py_test(
":loader",
":utils",
"//tensorflow:tensorflow_py",
"//tensorflow/contrib/session_bundle:manifest_proto_py",
"//tensorflow/core:protos_all_py",
"//tensorflow/python:framework",
"//tensorflow/python:framework_for_generated_wrappers",
......
......@@ -26,7 +26,7 @@ import os
from google.protobuf.any_pb2 import Any
from tensorflow.contrib.session_bundle import manifest_pb2
from tensorflow.core.protobuf import meta_graph_pb2
from tensorflow.core.protobuf import saved_model_pb2
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
......@@ -123,12 +123,12 @@ class SavedModelBuilder(object):
Args:
asset_filename: The filename of the asset to be added.
asset_tensor: The asset tensor used to populate the tensor binding of the
asset_tensor: The asset tensor used to populate the tensor info of the
asset proto.
"""
asset_proto = manifest_pb2.AssetFile()
asset_proto = meta_graph_pb2.AssetFileDef()
asset_proto.filename = asset_filename
asset_proto.tensor_binding.tensor_name = asset_tensor.name
asset_proto.tensor_info.name = asset_tensor.name
asset_any_proto = Any()
asset_any_proto.Pack(asset_proto)
......
......@@ -20,8 +20,8 @@ from __future__ import print_function
import os
import tensorflow as tf
from tensorflow.contrib.session_bundle import manifest_pb2
from tensorflow.core.protobuf import config_pb2
from tensorflow.core.protobuf import meta_graph_pb2
from tensorflow.python.framework import errors
from tensorflow.python.lib.io import file_io
from tensorflow.python.saved_model import builder as saved_model_builder
......@@ -363,7 +363,7 @@ class SavedModelTest(tf.test.TestCase):
collection_def = foo_graph.collection_def
assets_any = collection_def[constants.ASSETS_KEY].any_list.value
self.assertEqual(len(assets_any), 1)
asset = manifest_pb2.AssetFile()
asset = meta_graph_pb2.AssetFileDef()
assets_any[0].Unpack(asset)
assets_path = os.path.join(
compat.as_bytes(export_dir),
......@@ -372,7 +372,7 @@ class SavedModelTest(tf.test.TestCase):
asset_contents = file_io.read_file_to_string(assets_path)
self.assertEqual("foo bar baz", compat.as_text(asset_contents))
self.assertEqual("hello42.txt", asset.filename)
self.assertEqual("asset_file_tensor:0", asset.tensor_binding.tensor_name)
self.assertEqual("asset_file_tensor:0", asset.tensor_info.name)
ignored_asset_path = os.path.join(
compat.as_bytes(export_dir),
compat.as_bytes(constants.ASSETS_DIRECTORY),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册