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
ada2ed77
Commit
ada2ed77
authored
Nov 01, 2019
by
Yeqing Li
Committed by
A. Unique TensorFlower
Nov 01, 2019
Browse files
Internal change
PiperOrigin-RevId: 277960691
parent
37c12026
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
official/vision/detection/dataloader/input_reader.py
official/vision/detection/dataloader/input_reader.py
+5
-6
No files found.
official/vision/detection/dataloader/input_reader.py
View file @
ada2ed77
...
...
@@ -79,11 +79,9 @@ class InputFn(object):
if
self
.
_is_training
:
dataset
=
dataset
.
repeat
()
dataset
=
dataset
.
apply
(
tf
.
data
.
experimental
.
parallel_interleave
(
lambda
file_name
:
self
.
_dataset_fn
(
file_name
).
prefetch
(
1
),
cycle_length
=
32
,
sloppy
=
self
.
_is_training
))
dataset
=
dataset
.
interleave
(
map_func
=
lambda
file_name
:
self
.
_dataset_fn
(
file_name
),
cycle_length
=
32
,
num_parallel_calls
=
tf
.
data
.
experimental
.
AUTOTUNE
)
if
self
.
_is_training
:
dataset
=
dataset
.
shuffle
(
64
)
...
...
@@ -91,7 +89,8 @@ class InputFn(object):
dataset
=
dataset
.
take
(
self
.
_num_examples
)
# Parses the fetched records to input tensors for model function.
dataset
=
dataset
.
map
(
self
.
_parser_fn
,
num_parallel_calls
=
64
)
dataset
=
dataset
.
map
(
self
.
_parser_fn
,
num_parallel_calls
=
tf
.
data
.
experimental
.
AUTOTUNE
)
dataset
=
dataset
.
batch
(
batch_size
,
drop_remainder
=
True
)
dataset
=
dataset
.
prefetch
(
tf
.
data
.
experimental
.
AUTOTUNE
)
return
dataset
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