deepr.jobs.OptimizeSavedModel
- class deepr.jobs.OptimizeSavedModel(path_saved_model, path_optimized_model, graph_name, feeds, fetch, new_names=<factory>, blacklisted_variables=<factory>)[source]
Converts SavedModel into an optimized protobuf for inference
This job reads the input SavedModel, rename some nodes using the
new_names
argument (raises an error if some renames cannot be found), create placeholders given byfeeds
(and removes all other placeholders not in this list), and finally freezes the sub graph that produces the output tensorfetch
.When creating the original SavedModel, it is recommended to use
tf.identity
operators to mark some tensors as future feeds or fetches.WARNING: successful completion of this job is no guarantee that the exported Graph is correct. It is recommended to test the export in a separate job.
- blacklisted_variables
List of variable names not to include in the export
- __init__(path_saved_model, path_optimized_model, graph_name, feeds, fetch, new_names=<factory>, blacklisted_variables=<factory>)
Methods
__init__
(path_saved_model, ...[, new_names, ...])run
()Run Job
Attributes