Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
b729e4ec
Commit
b729e4ec
authored
May 13, 2022
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 448644197
parent
bce895d9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
official/vision/beta/projects/yolo/serving/export_module_factory.py
...ision/beta/projects/yolo/serving/export_module_factory.py
+1
-0
official/vision/serving/export_saved_model_lib.py
official/vision/serving/export_saved_model_lib.py
+7
-3
No files found.
official/vision/beta/projects/yolo/serving/export_module_factory.py
View file @
b729e4ec
...
@@ -61,6 +61,7 @@ class ExportModule(export_base.ExportModule):
...
@@ -61,6 +61,7 @@ class ExportModule(export_base.ExportModule):
preprocessor
=
preprocessor
,
preprocessor
=
preprocessor
,
inference_step
=
inference_step
,
inference_step
=
inference_step
,
postprocessor
=
postprocessor
)
postprocessor
=
postprocessor
)
self
.
eval_postprocessor
=
eval_postprocessor
self
.
input_signature
=
input_signature
self
.
input_signature
=
input_signature
@
tf
.
function
@
tf
.
function
...
...
official/vision/serving/export_saved_model_lib.py
View file @
b729e4ec
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
r
"""Vision models export utility function for serving/inference."""
r
"""Vision models export utility function for serving/inference."""
import
os
import
os
from
typing
import
Optional
,
List
from
typing
import
Optional
,
List
,
Union
,
Text
,
Dict
from
absl
import
logging
from
absl
import
logging
import
tensorflow
as
tf
import
tensorflow
as
tf
...
@@ -44,7 +44,8 @@ def export_inference_graph(
...
@@ -44,7 +44,8 @@ def export_inference_graph(
save_options
:
Optional
[
tf
.
saved_model
.
SaveOptions
]
=
None
,
save_options
:
Optional
[
tf
.
saved_model
.
SaveOptions
]
=
None
,
log_model_flops_and_params
:
bool
=
False
,
log_model_flops_and_params
:
bool
=
False
,
checkpoint
:
Optional
[
tf
.
train
.
Checkpoint
]
=
None
,
checkpoint
:
Optional
[
tf
.
train
.
Checkpoint
]
=
None
,
input_name
:
Optional
[
str
]
=
None
):
input_name
:
Optional
[
str
]
=
None
,
function_keys
:
Optional
[
Union
[
List
[
Text
],
Dict
[
Text
,
Text
]]]
=
None
,):
"""Exports inference graph for the model specified in the exp config.
"""Exports inference graph for the model specified in the exp config.
Saved model is stored at export_dir/saved_model, checkpoint is saved
Saved model is stored at export_dir/saved_model, checkpoint is saved
...
@@ -72,6 +73,9 @@ def export_inference_graph(
...
@@ -72,6 +73,9 @@ def export_inference_graph(
will use it to read the weights.
will use it to read the weights.
input_name: The input tensor name, default at `None` which produces input
input_name: The input tensor name, default at `None` which produces input
tensor name `inputs`.
tensor name `inputs`.
function_keys: a list of string keys to retrieve pre-defined serving
signatures. The signaute keys will be set with defaults. If a dictionary
is provided, the values will be used as signature keys.
"""
"""
if
export_checkpoint_subdir
:
if
export_checkpoint_subdir
:
...
@@ -130,7 +134,7 @@ def export_inference_graph(
...
@@ -130,7 +134,7 @@ def export_inference_graph(
export_base
.
export
(
export_base
.
export
(
export_module
,
export_module
,
function_keys
=
[
input_type
],
function_keys
=
function_keys
if
function_keys
else
[
input_type
],
export_savedmodel_dir
=
output_saved_model_directory
,
export_savedmodel_dir
=
output_saved_model_directory
,
checkpoint
=
checkpoint
,
checkpoint
=
checkpoint
,
checkpoint_path
=
checkpoint_path
,
checkpoint_path
=
checkpoint_path
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment