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
e5de97b4
Commit
e5de97b4
authored
Jul 18, 2017
by
Derek Chow
Browse files
Do not optimize graph by default.
parent
4ddc9f2d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
object_detection/export_inference_graph.py
object_detection/export_inference_graph.py
+5
-3
object_detection/exporter.py
object_detection/exporter.py
+3
-3
No files found.
object_detection/export_inference_graph.py
View file @
e5de97b4
...
@@ -85,13 +85,15 @@ flags.DEFINE_string('trained_checkpoint_prefix', None,
...
@@ -85,13 +85,15 @@ flags.DEFINE_string('trained_checkpoint_prefix', None,
'path/to/model.ckpt'
)
'path/to/model.ckpt'
)
flags
.
DEFINE_string
(
'output_directory'
,
None
,
'Path to write outputs.'
)
flags
.
DEFINE_string
(
'output_directory'
,
None
,
'Path to write outputs.'
)
tf
.
app
.
flags
.
MarkFlagAsRequired
(
'pipeline_config_path'
)
tf
.
app
.
flags
.
MarkFlagAsRequired
(
'trained_checkpoint_prefix'
)
tf
.
app
.
flags
.
MarkFlagAsRequired
(
'output_directory'
)
FLAGS
=
flags
.
FLAGS
FLAGS
=
flags
.
FLAGS
def
main
(
_
):
def
main
(
_
):
assert
FLAGS
.
pipeline_config_path
,
'`pipeline_config_path` is missing'
assert
FLAGS
.
trained_checkpoint_prefix
,
(
'`trained_checkpoint_prefix` is missing'
)
assert
FLAGS
.
output_directory
,
'`output_directory` is missing'
pipeline_config
=
pipeline_pb2
.
TrainEvalPipelineConfig
()
pipeline_config
=
pipeline_pb2
.
TrainEvalPipelineConfig
()
with
tf
.
gfile
.
GFile
(
FLAGS
.
pipeline_config_path
,
'r'
)
as
f
:
with
tf
.
gfile
.
GFile
(
FLAGS
.
pipeline_config_path
,
'r'
)
as
f
:
text_format
.
Merge
(
f
.
read
(),
pipeline_config
)
text_format
.
Merge
(
f
.
read
(),
pipeline_config
)
...
...
object_detection/exporter.py
View file @
e5de97b4
...
@@ -43,7 +43,7 @@ def freeze_graph_with_def_protos(
...
@@ -43,7 +43,7 @@ def freeze_graph_with_def_protos(
filename_tensor_name
,
filename_tensor_name
,
clear_devices
,
clear_devices
,
initializer_nodes
,
initializer_nodes
,
optimize_graph
=
Tru
e
,
optimize_graph
=
Fals
e
,
variable_names_blacklist
=
''
):
variable_names_blacklist
=
''
):
"""Converts all variables in a graph and checkpoint into constants."""
"""Converts all variables in a graph and checkpoint into constants."""
del
restore_op_name
,
filename_tensor_name
# Unused by updated loading code.
del
restore_op_name
,
filename_tensor_name
# Unused by updated loading code.
...
@@ -289,7 +289,7 @@ def _export_inference_graph(input_type,
...
@@ -289,7 +289,7 @@ def _export_inference_graph(input_type,
use_moving_averages
,
use_moving_averages
,
trained_checkpoint_prefix
,
trained_checkpoint_prefix
,
output_directory
,
output_directory
,
optimize_graph
=
Tru
e
,
optimize_graph
=
Fals
e
,
output_collection_name
=
'inference_op'
):
output_collection_name
=
'inference_op'
):
"""Export helper."""
"""Export helper."""
tf
.
gfile
.
MakeDirs
(
output_directory
)
tf
.
gfile
.
MakeDirs
(
output_directory
)
...
@@ -340,7 +340,7 @@ def export_inference_graph(input_type,
...
@@ -340,7 +340,7 @@ def export_inference_graph(input_type,
pipeline_config
,
pipeline_config
,
trained_checkpoint_prefix
,
trained_checkpoint_prefix
,
output_directory
,
output_directory
,
optimize_graph
=
Tru
e
,
optimize_graph
=
Fals
e
,
output_collection_name
=
'inference_op'
):
output_collection_name
=
'inference_op'
):
"""Exports inference graph for the model specified in the pipeline config.
"""Exports inference graph for the model specified in the pipeline config.
...
...
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