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
614d3d93
Commit
614d3d93
authored
Oct 20, 2021
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 404687702
parent
56c34e5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
official/projects/edgetpu/vision/serving/export_tflite.py
official/projects/edgetpu/vision/serving/export_tflite.py
+9
-1
No files found.
official/projects/edgetpu/vision/serving/export_tflite.py
View file @
614d3d93
...
...
@@ -50,6 +50,11 @@ flags.DEFINE_enum(
[
'tf_checkpoint'
,
'keras_checkpoint'
],
'tf_checkpoint is for ckpt files from tf.train.Checkpoint.save() method'
'keras_checkpoint is for ckpt files from keras.Model.save_weights() method'
)
flags
.
DEFINE_bool
(
'export_keras_model'
,
False
,
'Export SavedModel format: if False, export TF SavedModel with'
'tf.saved_model API; if True, export Keras SavedModel with tf.keras.Model'
'API.'
)
flags
.
DEFINE_string
(
'output_dir'
,
None
,
'Directory to output exported files.'
)
flags
.
DEFINE_integer
(
'image_size'
,
224
,
...
...
@@ -161,7 +166,10 @@ def run_export():
# Export saved model.
saved_model_path
=
os
.
path
.
join
(
export_config
.
output_dir
,
export_config
.
model_name
)
model_for_inference
.
save
(
saved_model_path
)
if
FLAGS
.
export_keras_model
:
model_for_inference
.
save
(
saved_model_path
)
else
:
tf
.
saved_model
.
save
(
model_for_inference
,
saved_model_path
)
print
(
'SavedModel exported to {}'
.
format
(
saved_model_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