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
05f59def
Commit
05f59def
authored
Sep 09, 2021
by
Shaoshuai Shi
Browse files
support clean sharedmemory after training
parent
880257ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
pcdet/datasets/waymo/waymo_dataset.py
pcdet/datasets/waymo/waymo_dataset.py
+21
-0
tools/train.py
tools/train.py
+2
-0
No files found.
pcdet/datasets/waymo/waymo_dataset.py
View file @
05f59def
...
...
@@ -96,6 +96,27 @@ class WaymoDataset(DatasetTemplate):
dist
.
barrier
()
self
.
logger
.
info
(
'Training data has been saved to shared memory'
)
def
clean_shared_memory
(
self
):
self
.
logger
.
info
(
f
'Clean training data from shared memory (file limit=
{
self
.
shared_memory_file_limit
}
)'
)
cur_rank
,
num_gpus
=
common_utils
.
get_dist_info
()
all_infos
=
self
.
infos
[:
self
.
shared_memory_file_limit
]
\
if
self
.
shared_memory_file_limit
<
len
(
self
.
infos
)
else
self
.
infos
cur_infos
=
all_infos
[
cur_rank
::
num_gpus
]
for
info
in
cur_infos
:
pc_info
=
info
[
'point_cloud'
]
sequence_name
=
pc_info
[
'lidar_sequence'
]
sample_idx
=
pc_info
[
'sample_idx'
]
sa_key
=
f
'
{
sequence_name
}
___
{
sample_idx
}
'
if
not
os
.
path
.
exists
(
f
"/dev/shm/
{
sa_key
}
"
):
continue
SharedArray
.
delete
(
f
"shm://
{
sa_key
}
"
)
dist
.
barrier
()
self
.
logger
.
info
(
'Training data has been deleted from shared memory'
)
@
staticmethod
def
check_sequence_name_with_all_version
(
sequence_file
):
if
not
sequence_file
.
exists
():
...
...
tools/train.py
View file @
05f59def
...
...
@@ -193,6 +193,8 @@ def main():
logger
.
info
(
'**********************End evaluation %s/%s(%s)**********************'
%
(
cfg
.
EXP_GROUP_PATH
,
cfg
.
TAG
,
args
.
extra_tag
))
if
hasattr
(
train_set
,
'use_shared_memory'
)
and
train_set
.
use_shared_memory
:
train_set
.
clean_shared_memory
()
if
__name__
==
'__main__'
:
main
()
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