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

[Relay]Refine tensorflow frontend 1.x & 2.x compatibility #6240

Merged
merged 3 commits into from Aug 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 9 additions & 5 deletions python/tvm/relay/frontend/tensorflow_parser.py
Expand Up @@ -67,12 +67,16 @@ def _load_pb_file(self):
def _get_tag_set(self):
"""Return the tag set of saved model, multiple metagraphs are not supported"""
try:
from tensorflow.contrib.saved_model.python.saved_model import reader
from tensorflow.contrib.saved_model.python.saved_model.reader \
import get_saved_model_tag_sets
except ImportError:
raise ImportError(
"InputConfiguration: Unable to import saved_model.reader which is "
"required to get tag set from saved model.")
tag_sets = reader.get_saved_model_tag_sets(self._model_dir)
try:
from tensorflow.python.tools.saved_model_utils import get_saved_model_tag_sets
except ImportError:
raise ImportError(
"InputConfiguration: Unable to import get_saved_model_tag_sets which is "
"required to get tag set from saved model.")
tag_sets = get_saved_model_tag_sets(self._model_dir)
return tag_sets[0]

def _get_output_names(self):
Expand Down