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
454f8be7
Commit
454f8be7
authored
Mar 12, 2021
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 362548055
parent
fd90a65f
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
195 additions
and
156 deletions
+195
-156
official/vision/beta/modeling/backbones/mobilenet.py
official/vision/beta/modeling/backbones/mobilenet.py
+182
-143
official/vision/beta/modeling/backbones/mobilenet_test.py
official/vision/beta/modeling/backbones/mobilenet_test.py
+13
-13
No files found.
official/vision/beta/modeling/backbones/mobilenet.py
View file @
454f8be7
This diff is collapsed.
Click to expand it.
official/vision/beta/modeling/backbones/mobilenet_test.py
View file @
454f8be7
...
@@ -109,27 +109,27 @@ class MobileNetTest(parameterized.TestCase, tf.test.TestCase):
...
@@ -109,27 +109,27 @@ class MobileNetTest(parameterized.TestCase, tf.test.TestCase):
tf
.
keras
.
backend
.
set_image_data_format
(
'channels_last'
)
tf
.
keras
.
backend
.
set_image_data_format
(
'channels_last'
)
mobilenet_layers
=
{
mobilenet_layers
=
{
# The
stride (relative to input) and number of filters
# The
number of filters of layers having outputs been collected
#
of first few layers
for filter_size_scale =
0.75
# for filter_size_scale =
1.0
'MobileNetV1'
:
[
(
1
,
24
),
(
1
,
48
),
(
2
,
96
),
(
2
,
96
)
],
'MobileNetV1'
:
[
128
,
256
,
512
,
1024
],
'MobileNetV2'
:
[
(
1
,
24
)
,
(
1
,
16
),
(
2
,
24
),
(
2
,
24
)
],
'MobileNetV2'
:
[
24
,
32
,
96
,
320
],
'MobileNetV3Small'
:
[
(
1
,
16
),
(
2
,
16
),
(
3
,
24
)
,
(
3
,
24
)
],
'MobileNetV3Small'
:
[
16
,
24
,
48
,
96
],
'MobileNetV3Large'
:
[
(
1
,
16
),
(
1
,
16
),
(
2
,
24
),
(
2
,
24
)
],
'MobileNetV3Large'
:
[
24
,
40
,
112
,
160
],
'MobileNetV3EdgeTPU'
:
[
(
1
,
24
),
(
1
,
16
),
(
2
,
24
),
(
2
,
24
)
],
'MobileNetV3EdgeTPU'
:
[
32
,
48
,
96
,
192
],
'MobileNetMultiMAX'
:
[
(
1
,
24
),
(
2
,
24
),
(
3
,
48
),
(
3
,
48
)
],
'MobileNetMultiMAX'
:
[
32
,
64
,
128
,
160
],
'MobileNetMultiAVG'
:
[
(
1
,
24
),
(
2
,
24
),
(
2
,
24
),
(
3
,
48
)
],
'MobileNetMultiAVG'
:
[
32
,
64
,
160
,
192
],
}
}
network
=
mobilenet
.
MobileNet
(
model_id
=
model_id
,
network
=
mobilenet
.
MobileNet
(
model_id
=
model_id
,
filter_size_scale
=
0.75
)
filter_size_scale
=
1.0
)
inputs
=
tf
.
keras
.
Input
(
shape
=
(
input_size
,
input_size
,
3
),
batch_size
=
1
)
inputs
=
tf
.
keras
.
Input
(
shape
=
(
input_size
,
input_size
,
3
),
batch_size
=
1
)
endpoints
=
network
(
inputs
)
endpoints
=
network
(
inputs
)
for
idx
,
(
stride
,
num_filter
)
in
enumerate
(
mobilenet_layers
[
model_id
]):
for
idx
,
num_filter
in
enumerate
(
mobilenet_layers
[
model_id
]):
self
.
assertAllEqual
(
self
.
assertAllEqual
(
[
1
,
input_size
/
2
**
stride
,
input_size
/
2
**
stride
,
num_filter
],
[
1
,
input_size
/
2
**
(
idx
+
2
)
,
input_size
/
2
**
(
idx
+
2
)
,
num_filter
],
endpoints
[
idx
+
1
].
shape
.
as_list
())
endpoints
[
str
(
idx
+
2
)
].
shape
.
as_list
())
@
parameterized
.
parameters
(
@
parameterized
.
parameters
(
itertools
.
product
(
itertools
.
product
(
...
...
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