Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change dependency from saved_model_cli to saved_model_utils #7039

Merged
merged 5 commits into from
Nov 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
from tensorflow.python.keras.saving.saving_utils import model_input_signature
from tensorflow.python.saved_model.load import load
from tensorflow.python.saved_model import loader
from tensorflow.python.tools.saved_model_utils import get_meta_graph_def
from tensorflow.python.training.saver import export_meta_graph
from tensorflow.python.tools.saved_model_cli import get_signature_def_map
from tensorflow.saved_model.experimental import TrackableResource
from google.protobuf.json_format import MessageToDict
import tensorflow_hub as hub
Expand Down Expand Up @@ -640,7 +640,8 @@ def _load_model(saved_model_dir, saved_model_tags):
return model

def _find_signature(saved_model_dir, saved_model_tags, signature_def):
signature_def_map = get_signature_def_map(saved_model_dir, saved_model_tags)
meta_graph = get_meta_graph_def(saved_model_dir, saved_model_tags)
signature_def_map = meta_graph.signature_def
if signature_def not in signature_def_map.keys():
raise ValueError('Signature "%s" does not exist in the saved model'
% (signature_def))
Expand Down