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
OpenDAS
OpenPCDet
Commits
0dd5326e
Commit
0dd5326e
authored
Jul 09, 2020
by
Shaoshuai Shi
Browse files
bugfixed: support merge_all_iters_to_one_epoch in dataloader
parent
7ef14309
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
pcdet/datasets/__init__.py
pcdet/datasets/__init__.py
+6
-1
tools/train.py
tools/train.py
+3
-1
No files found.
pcdet/datasets/__init__.py
View file @
0dd5326e
...
...
@@ -37,7 +37,7 @@ class DistributedSampler(_DistributedSampler):
def
build_dataloader
(
dataset_cfg
,
class_names
,
batch_size
,
dist
,
root_path
=
None
,
workers
=
4
,
logger
=
None
,
training
=
True
):
logger
=
None
,
training
=
True
,
merge_all_iters_to_one_epoch
=
False
,
total_epochs
=
0
):
dataset
=
__all__
[
dataset_cfg
.
DATASET
](
dataset_cfg
=
dataset_cfg
,
...
...
@@ -46,6 +46,11 @@ def build_dataloader(dataset_cfg, class_names, batch_size, dist, root_path=None,
training
=
training
,
logger
=
logger
,
)
if
merge_all_iters_to_one_epoch
:
assert
hasattr
(
dataset
,
'merge_all_iters_to_one_epoch'
)
dataset
.
merge_all_iters_to_one_epoch
(
merge
=
True
,
epochs
=
total_epochs
)
if
dist
:
if
training
:
sampler
=
torch
.
utils
.
data
.
distributed
.
DistributedSampler
(
dataset
)
...
...
tools/train.py
View file @
0dd5326e
...
...
@@ -96,7 +96,9 @@ def main():
batch_size
=
args
.
batch_size
,
dist
=
dist_train
,
workers
=
args
.
workers
,
logger
=
logger
,
training
=
True
training
=
True
,
merge_all_iters_to_one_epoch
=
args
.
merge_all_iters_to_one_epoch
,
total_epochs
=
args
.
epochs
)
model
=
build_network
(
model_cfg
=
cfg
.
MODEL
,
num_class
=
len
(
cfg
.
CLASS_NAMES
),
dataset
=
train_set
)
...
...
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