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
f20a9ef6
Commit
f20a9ef6
authored
Sep 19, 2022
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 475418214
parent
303ba2e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
official/projects/edgetpu/vision/serving/export_tflite.py
official/projects/edgetpu/vision/serving/export_tflite.py
+5
-1
No files found.
official/projects/edgetpu/vision/serving/export_tflite.py
View file @
f20a9ef6
...
@@ -60,6 +60,8 @@ flags.DEFINE_integer(
...
@@ -60,6 +60,8 @@ flags.DEFINE_integer(
'image_size'
,
224
,
'image_size'
,
224
,
'Size of the input image. Ideally should be the same as the image_size used '
'Size of the input image. Ideally should be the same as the image_size used '
'in training config.'
)
'in training config.'
)
flags
.
DEFINE_bool
(
'fix_batch_size'
,
True
,
'Whether to export model with fixed batch size.'
)
flags
.
DEFINE_string
(
flags
.
DEFINE_string
(
'output_layer'
,
None
,
'output_layer'
,
None
,
'Layer name to take the output from. Can be used to take the output from '
'Layer name to take the output from. Can be used to take the output from '
...
@@ -146,9 +148,11 @@ def run_export():
...
@@ -146,9 +148,11 @@ def run_export():
output_layer
=
model
.
get_layer
(
export_config
.
output_layer
)
output_layer
=
model
.
get_layer
(
export_config
.
output_layer
)
model
=
tf
.
keras
.
Model
(
model
.
input
,
output_layer
.
output
)
model
=
tf
.
keras
.
Model
(
model
.
input
,
output_layer
.
output
)
batch_size
=
1
if
FLAGS
.
fix_batch_size
else
None
model_input
=
tf
.
keras
.
Input
(
model_input
=
tf
.
keras
.
Input
(
shape
=
(
export_config
.
image_size
,
export_config
.
image_size
,
3
),
shape
=
(
export_config
.
image_size
,
export_config
.
image_size
,
3
),
batch_size
=
1
)
batch_size
=
batch_size
)
model_output
=
export_util
.
finalize_serving
(
model
(
model_input
),
export_config
)
model_output
=
export_util
.
finalize_serving
(
model
(
model_input
),
export_config
)
model_for_inference
=
tf
.
keras
.
Model
(
model_input
,
model_output
)
model_for_inference
=
tf
.
keras
.
Model
(
model_input
,
model_output
)
...
...
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