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
1eddd748
Commit
1eddd748
authored
Apr 02, 2021
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 366496850
parent
c9768389
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
official/vision/beta/dataloaders/retinanet_input.py
official/vision/beta/dataloaders/retinanet_input.py
+6
-8
No files found.
official/vision/beta/dataloaders/retinanet_input.py
View file @
1eddd748
...
...
@@ -112,8 +112,8 @@ class Parser(parser.Parser):
self
.
_use_autoaugment
=
use_autoaugment
self
.
_autoaugment_policy_name
=
autoaugment_policy_name
# D
evic
e.
self
.
_
use_bfloat16
=
True
if
dtype
==
'bfloat16'
else
Fals
e
# D
ata typ
e.
self
.
_
dtype
=
dtyp
e
def
_parse_train_data
(
self
,
data
):
"""Parses data for training and evaluation."""
...
...
@@ -180,9 +180,8 @@ class Parser(parser.Parser):
box_weights
)
=
anchor_labeler
.
label_anchors
(
anchor_boxes
,
boxes
,
tf
.
expand_dims
(
classes
,
axis
=
1
))
# If bfloat16 is used, casts input image to tf.bfloat16.
if
self
.
_use_bfloat16
:
image
=
tf
.
cast
(
image
,
dtype
=
tf
.
bfloat16
)
# Casts input image to desired data type.
image
=
tf
.
cast
(
image
,
dtype
=
self
.
_dtype
)
# Packs labels for model_fn outputs.
labels
=
{
...
...
@@ -245,9 +244,8 @@ class Parser(parser.Parser):
box_weights
)
=
anchor_labeler
.
label_anchors
(
anchor_boxes
,
boxes
,
tf
.
expand_dims
(
classes
,
axis
=
1
))
# If bfloat16 is used, casts input image to tf.bfloat16.
if
self
.
_use_bfloat16
:
image
=
tf
.
cast
(
image
,
dtype
=
tf
.
bfloat16
)
# Casts input image to desired data type.
image
=
tf
.
cast
(
image
,
dtype
=
self
.
_dtype
)
# Sets up groundtruth data for evaluation.
groundtruths
=
{
...
...
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