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
be205db2
Commit
be205db2
authored
Oct 12, 2022
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 480706898
parent
3347c155
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
official/projects/edgetpu/vision/serving/export_util.py
official/projects/edgetpu/vision/serving/export_util.py
+3
-3
No files found.
official/projects/edgetpu/vision/serving/export_util.py
View file @
be205db2
...
...
@@ -189,8 +189,7 @@ def representative_dataset_gen(export_config):
"""Gets a python generator of numpy arrays for the given dataset."""
quantization_config
=
export_config
.
quantization_config
dataset
=
tfds
.
builder
(
quantization_config
.
dataset_name
,
data_dir
=
quantization_config
.
dataset_dir
)
quantization_config
.
dataset_name
,
try_gcs
=
True
)
dataset
.
download_and_prepare
()
data
=
dataset
.
as_dataset
()[
quantization_config
.
dataset_split
]
iterator
=
data
.
as_numpy_iterator
()
...
...
@@ -207,7 +206,8 @@ def configure_tflite_converter(export_config, converter):
"""Common code for picking up quantization parameters."""
quantization_config
=
export_config
.
quantization_config
if
quantization_config
.
quantize
:
if
quantization_config
.
dataset_dir
is
None
:
if
(
quantization_config
.
dataset_dir
is
None
)
and
(
quantization_config
.
dataset_name
is
None
):
raise
ValueError
(
'Must provide a representative dataset when quantizing the model.'
)
converter
.
optimizations
=
[
tf
.
lite
.
Optimize
.
DEFAULT
]
...
...
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