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
aa75f089
Commit
aa75f089
authored
Oct 29, 2021
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 406303006
parent
2fec36b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
official/projects/edgetpu/vision/serving/export_tflite_test.py
...ial/projects/edgetpu/vision/serving/export_tflite_test.py
+25
-1
No files found.
official/projects/edgetpu/vision/serving/export_tflite_test.py
View file @
aa75f089
...
...
@@ -20,11 +20,35 @@ import os
from
absl.testing
import
parameterized
import
tensorflow
as
tf
from
official.core
import
exp_factory
from
official.core
import
task_factory
from
official.projects.edgetpu.vision.serving
import
export_util
def
_build_experiment_model
(
experiment_type
):
"""Builds model from experiment type configuration w/o loading checkpoint.
To reduce test latency and avoid unexpected errors (e.g. checkpoint files not
exist in the dedicated path), we skip the checkpoint loading for the tests.
Args:
experiment_type: model type for the experiment.
Returns:
TF/Keras model for the task.
"""
params
=
exp_factory
.
get_exp_config
(
experiment_type
)
if
'deeplabv3plus_mobilenet_edgetpuv2'
in
experiment_type
:
params
.
task
.
model
.
backbone
.
mobilenet_edgetpu
.
pretrained_checkpoint_path
=
None
if
'autoseg_edgetpu'
in
experiment_type
:
params
.
task
.
model
.
model_params
.
model_weights_path
=
None
params
.
validate
()
params
.
lock
()
task
=
task_factory
.
get_task
(
params
.
task
)
return
task
.
build_model
()
def
_build_model
(
config
):
model
=
export_util
.
build_experiment_model
(
config
.
model_name
)
model
=
_
build_experiment_model
(
config
.
model_name
)
model_input
=
tf
.
keras
.
Input
(
shape
=
(
config
.
image_size
,
config
.
image_size
,
3
),
batch_size
=
1
)
model_output
=
export_util
.
finalize_serving
(
model
(
model_input
),
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