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
cdd0347a
Commit
cdd0347a
authored
Oct 26, 2020
by
Jonathan Huang
Committed by
TF Object Detection Team
Oct 26, 2020
Browse files
Adds a "drop_remainder" option for input readers to handle "exact" evals when batch_size>1.
PiperOrigin-RevId: 339071313
parent
282adff5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
research/object_detection/builders/dataset_builder.py
research/object_detection/builders/dataset_builder.py
+2
-1
research/object_detection/protos/input_reader.proto
research/object_detection/protos/input_reader.proto
+4
-1
No files found.
research/object_detection/builders/dataset_builder.py
View file @
cdd0347a
...
@@ -242,7 +242,8 @@ def build(input_reader_config, batch_size=None, transform_input_data_fn=None,
...
@@ -242,7 +242,8 @@ def build(input_reader_config, batch_size=None, transform_input_data_fn=None,
dataset
=
dataset_map_fn
(
dataset
,
transform_input_data_fn
,
dataset
=
dataset_map_fn
(
dataset
,
transform_input_data_fn
,
batch_size
,
input_reader_config
)
batch_size
,
input_reader_config
)
if
batch_size
:
if
batch_size
:
dataset
=
dataset
.
batch
(
batch_size
,
drop_remainder
=
True
)
dataset
=
dataset
.
batch
(
batch_size
,
drop_remainder
=
input_reader_config
.
drop_remainder
)
dataset
=
dataset
.
prefetch
(
input_reader_config
.
num_prefetch_batches
)
dataset
=
dataset
.
prefetch
(
input_reader_config
.
num_prefetch_batches
)
return
dataset
return
dataset
...
...
research/object_detection/protos/input_reader.proto
View file @
cdd0347a
...
@@ -30,7 +30,7 @@ enum InputType {
...
@@ -30,7 +30,7 @@ enum InputType {
TF_SEQUENCE_EXAMPLE
=
2
;
// TfSequenceExample Input
TF_SEQUENCE_EXAMPLE
=
2
;
// TfSequenceExample Input
}
}
// Next id: 3
5
// Next id: 3
6
message
InputReader
{
message
InputReader
{
// Name of input reader. Typically used to describe the dataset that is read
// Name of input reader. Typically used to describe the dataset that is read
// by this input reader.
// by this input reader.
...
@@ -93,6 +93,9 @@ message InputReader {
...
@@ -93,6 +93,9 @@ message InputReader {
// Number of parallel decode ops to apply.
// Number of parallel decode ops to apply.
optional
uint32
num_parallel_map_calls
=
14
[
default
=
64
,
deprecated
=
true
];
optional
uint32
num_parallel_map_calls
=
14
[
default
=
64
,
deprecated
=
true
];
// Drop remainder when batch size does not divide dataset size.
optional
bool
drop_remainder
=
35
[
default
=
true
];
// If positive, TfExampleDecoder will try to decode rasters of additional
// If positive, TfExampleDecoder will try to decode rasters of additional
// channels from tf.Examples.
// channels from tf.Examples.
optional
int32
num_additional_channels
=
18
[
default
=
0
];
optional
int32
num_additional_channels
=
18
[
default
=
0
];
...
...
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