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
32e4ca51
Commit
32e4ca51
authored
Nov 28, 2023
by
qianyj
Browse files
Update code to v2.11.0
parents
9485aa1d
71060f67
Changes
775
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
38 additions
and
38 deletions
+38
-38
official/projects/edgetpu/nlp/modeling/pretrainer_test.py
official/projects/edgetpu/nlp/modeling/pretrainer_test.py
+1
-1
official/projects/edgetpu/nlp/run_mobilebert_edgetpu_train.py
...cial/projects/edgetpu/nlp/run_mobilebert_edgetpu_train.py
+1
-1
official/projects/edgetpu/nlp/serving/__init__.py
official/projects/edgetpu/nlp/serving/__init__.py
+1
-1
official/projects/edgetpu/nlp/serving/export_tflite_squad.py
official/projects/edgetpu/nlp/serving/export_tflite_squad.py
+3
-2
official/projects/edgetpu/nlp/serving/export_tflite_squad_test.py
.../projects/edgetpu/nlp/serving/export_tflite_squad_test.py
+1
-1
official/projects/edgetpu/nlp/utils/__init__.py
official/projects/edgetpu/nlp/utils/__init__.py
+1
-1
official/projects/edgetpu/nlp/utils/utils.py
official/projects/edgetpu/nlp/utils/utils.py
+1
-1
official/projects/edgetpu/nlp/utils/utils_test.py
official/projects/edgetpu/nlp/utils/utils_test.py
+1
-1
official/projects/edgetpu/vision/README.md
official/projects/edgetpu/vision/README.md
+4
-4
official/projects/edgetpu/vision/__init__.py
official/projects/edgetpu/vision/__init__.py
+1
-1
official/projects/edgetpu/vision/configs/__init__.py
official/projects/edgetpu/vision/configs/__init__.py
+1
-1
official/projects/edgetpu/vision/configs/mobilenet_edgetpu_config.py
...ojects/edgetpu/vision/configs/mobilenet_edgetpu_config.py
+3
-3
official/projects/edgetpu/vision/configs/semantic_segmentation_config.py
...ts/edgetpu/vision/configs/semantic_segmentation_config.py
+5
-6
official/projects/edgetpu/vision/configs/semantic_segmentation_searched_config.py
...u/vision/configs/semantic_segmentation_searched_config.py
+3
-3
official/projects/edgetpu/vision/dataloaders/__init__.py
official/projects/edgetpu/vision/dataloaders/__init__.py
+1
-1
official/projects/edgetpu/vision/dataloaders/classification_input.py
...ojects/edgetpu/vision/dataloaders/classification_input.py
+3
-3
official/projects/edgetpu/vision/dataloaders/classification_input_test.py
...s/edgetpu/vision/dataloaders/classification_input_test.py
+3
-3
official/projects/edgetpu/vision/modeling/__init__.py
official/projects/edgetpu/vision/modeling/__init__.py
+1
-1
official/projects/edgetpu/vision/modeling/backbones/__init__.py
...al/projects/edgetpu/vision/modeling/backbones/__init__.py
+1
-1
official/projects/edgetpu/vision/modeling/backbones/mobilenet_edgetpu.py
...ts/edgetpu/vision/modeling/backbones/mobilenet_edgetpu.py
+2
-2
No files found.
Too many changes to show.
To preserve performance only
775 of 775+
files are displayed.
Plain diff
Email patch
official/projects/edgetpu/nlp/modeling/pretrainer_test.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/nlp/run_mobilebert_edgetpu_train.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/nlp/serving/__init__.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/nlp/serving/export_tflite_squad.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -135,7 +135,8 @@ def main(argv: Sequence[str]) -> None:
checkpoint
=
tf
.
train
.
Checkpoint
(
**
checkpoint_dict
)
checkpoint
.
restore
(
FLAGS
.
model_checkpoint
).
assert_existing_objects_matched
()
model_for_serving
=
build_model_for_serving
(
model
)
model_for_serving
=
build_model_for_serving
(
model
,
FLAGS
.
sequence_length
,
FLAGS
.
batch_size
)
model_for_serving
.
summary
()
# TODO(b/194449109): Need to save the model to file and then convert tflite
...
...
official/projects/edgetpu/nlp/serving/export_tflite_squad_test.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/nlp/utils/__init__.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/nlp/utils/utils.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/nlp/utils/utils_test.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/vision/README.md
View file @
32e4ca51
...
...
@@ -78,10 +78,10 @@ models for 224x224 input resolution:
Model (Checkpoint) | Accuracy (int8) | Pixel 6 Edge TPU Latency (ms) | tflite
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------: | :---------------------------: | :----:
[
MobileNetEdgeTPUv2-Tiny
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/tiny/mobilenet-edgetpu-v2-tiny.tar.gz
)
| 74.66% | 0.78 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/tiny/mobilenet_edgetpu_v2_tiny.tflite
)
[
MobileNetEdgeTPUv2-XS
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
tiny
/mobilenet-edgetpu-v2-xs.tar.gz
)
| 75.79% | 0.82 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
tiny
/mobilenet_edgetpu_v2_xs.tflite
)
[
MobileNetEdgeTPUv2-S
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
tiny
/mobilenet-edgetpu-v2-s.tar.gz
)
| 77.36% | 1.03 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
tiny
/mobilenet_edgetpu_v2_s.tflite
)
[
MobileNetEdgeTPUv2-M
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
tiny
/mobilenet-edgetpu-v2-m.tar.gz
)
| 78.43% | 1.35 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
tiny
/mobilenet_edgetpu_v2_m.tflite
)
[
MobileNetEdgeTPUv2-L
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
tiny
/mobilenet-edgetpu-v2-l.tar.gz
)
| 79.00% | 1.64 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
tiny
/mobilenet_edgetpu_v2_l.tflite
)
[
MobileNetEdgeTPUv2-XS
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
xs
/mobilenet-edgetpu-v2-xs.tar.gz
)
| 75.79% | 0.82 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
xs
/mobilenet_edgetpu_v2_xs.tflite
)
[
MobileNetEdgeTPUv2-S
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
s
/mobilenet-edgetpu-v2-s.tar.gz
)
| 77.36% | 1.03 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
s
/mobilenet_edgetpu_v2_s.tflite
)
[
MobileNetEdgeTPUv2-M
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
m
/mobilenet-edgetpu-v2-m.tar.gz
)
| 78.43% | 1.35 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
m
/mobilenet_edgetpu_v2_m.tflite
)
[
MobileNetEdgeTPUv2-L
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
l
/mobilenet-edgetpu-v2-l.tar.gz
)
| 79.00% | 1.64 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v2/
l
/mobilenet_edgetpu_v2_l.tflite
)
[
MobileNetEdgeTPU dm1.0
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v1/dm1p0/mobilenet-edgetpu-dm1p0.tar.gz
)
| 75.6% | 0.92 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v1/dm1p0/mobilenet_edgetpu.tflite
)
[
MobileNetEdgeTPU dm1.25
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v1/dm1p25/mobilenet-edgetpu-dm1p25.tar.gz
)
| 77.06% | 1.20 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v1/dm1p25/mobilenet_edgetpu_dm1p25.tflite
)
[
MobileNetEdgeTPU dm1.5
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v1/dm1p5/mobilenet-edgetpu-dm1p5.tar.gz
)
| 75.9% | 1.42 |
[
link
](
https://storage.cloud.google.com/tf_model_garden/models/edgetpu/checkpoint_and_tflite/vision/mobilenet-edgetpu-v1/dm1p5/mobilenet_edgetpu_dm1p5.tflite
)
...
...
official/projects/edgetpu/vision/__init__.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/vision/configs/__init__.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/vision/configs/mobilenet_edgetpu_config.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -24,8 +24,8 @@ from typing import Any, Mapping, Optional
from
official.core
import
config_definitions
as
cfg
from
official.core
import
exp_factory
from
official.modeling
import
optimization
from
official.vision.
beta.
configs
import
common
from
official.vision.
beta.
configs
import
image_classification
as
base_config
from
official.vision.configs
import
common
from
official.vision.configs
import
image_classification
as
base_config
@
dataclasses
.
dataclass
...
...
official/projects/edgetpu/vision/configs/semantic_segmentation_config.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Lint as: python3
"""Semantic segmentation configuration definition.
The segmentation model is built using the mobilenet edgetpu v2 backbone and
...
...
@@ -25,10 +24,10 @@ from official.core import config_definitions as cfg
from
official.core
import
exp_factory
from
official.modeling
import
hyperparams
from
official.modeling
import
optimization
from
official.vision.
beta.
configs
import
backbones
from
official.vision.
beta.
configs
import
common
from
official.vision.
beta.
configs
import
decoders
from
official.vision.
beta.
configs
import
semantic_segmentation
as
base_cfg
from
official.vision.configs
import
backbones
from
official.vision.configs
import
common
from
official.vision.configs
import
decoders
from
official.vision.configs
import
semantic_segmentation
as
base_cfg
@
dataclasses
.
dataclass
...
...
official/projects/edgetpu/vision/configs/semantic_segmentation_searched_config.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -26,8 +26,8 @@ from official.core import config_definitions as cfg
from
official.core
import
exp_factory
from
official.modeling
import
hyperparams
from
official.modeling
import
optimization
from
official.vision.
beta.
configs
import
backbones
from
official.vision.
beta.
configs
import
semantic_segmentation
as
base_cfg
from
official.vision.configs
import
backbones
from
official.vision.configs
import
semantic_segmentation
as
base_cfg
# ADE 20K Dataset
ADE20K_TRAIN_EXAMPLES
=
20210
...
...
official/projects/edgetpu/vision/dataloaders/__init__.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/vision/dataloaders/classification_input.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -16,8 +16,8 @@
# Import libraries
import
tensorflow
as
tf
from
official.vision.
beta.
dataloaders
import
classification_input
from
official.vision.
beta.
ops
import
preprocess_ops
from
official.vision.dataloaders
import
classification_input
from
official.vision.ops
import
preprocess_ops
MEAN_RGB
=
(
0.5
*
255
,
0.5
*
255
,
0.5
*
255
)
STDDEV_RGB
=
(
0.5
*
255
,
0.5
*
255
,
0.5
*
255
)
...
...
official/projects/edgetpu/vision/dataloaders/classification_input_test.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -17,8 +17,8 @@
from
absl.testing
import
parameterized
import
tensorflow
as
tf
from
official.projects.edgetpu.vision.dataloaders
import
classification_input
from
official.vision.
beta.
configs
import
common
from
official.vision.
beta.
dataloaders
import
tfexample_utils
from
official.vision.configs
import
common
from
official.vision.dataloaders
import
tfexample_utils
IMAGE_FIELD_KEY
=
'image/encoded'
LABEL_FIELD_KEY
=
'image/class/label'
...
...
official/projects/edgetpu/vision/modeling/__init__.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/vision/modeling/backbones/__init__.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
official/projects/edgetpu/vision/modeling/backbones/mobilenet_edgetpu.py
View file @
32e4ca51
# Copyright 202
1
The TensorFlow Authors. All Rights Reserved.
# Copyright 202
2
The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
...
...
@@ -22,7 +22,7 @@ import tensorflow as tf
from
official.modeling
import
hyperparams
from
official.projects.edgetpu.vision.modeling.mobilenet_edgetpu_v1_model
import
MobilenetEdgeTPU
from
official.projects.edgetpu.vision.modeling.mobilenet_edgetpu_v2_model
import
MobilenetEdgeTPUV2
from
official.vision.
beta.
modeling.backbones
import
factory
from
official.vision.modeling.backbones
import
factory
layers
=
tf
.
keras
.
layers
...
...
Prev
1
…
33
34
35
36
37
38
39
Next
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