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
mmdetection3d
Commits
e29eb2a5
Commit
e29eb2a5
authored
May 11, 2020
by
zww
Browse files
Fix tiny bugs
parent
6d0be0a8
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
50 additions
and
25 deletions
+50
-25
configs/kitti/dv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py
...igs/kitti/dv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py
+2
-1
configs/kitti/dv_second_secfpn_2x8_cosine_80e_kitti-3d-3class.py
.../kitti/dv_second_secfpn_2x8_cosine_80e_kitti-3d-3class.py
+2
-1
configs/kitti/dv_second_secfpn_6x8_80e_kitti-3d-car.py
configs/kitti/dv_second_secfpn_6x8_80e_kitti-3d-car.py
+2
-1
configs/kitti/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py
...igs/kitti/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py
+2
-1
configs/kitti/hv_second_secfpn_6x8_80e_kitti-3d-car.py
configs/kitti/hv_second_secfpn_6x8_80e_kitti-3d-car.py
+2
-1
mmdet3d/datasets/kitti_dataset.py
mmdet3d/datasets/kitti_dataset.py
+2
-0
mmdet3d/ops/sparse_block.py
mmdet3d/ops/sparse_block.py
+1
-1
tools/dist_test.sh
tools/dist_test.sh
+10
-0
tools/dist_train.sh
tools/dist_train.sh
+3
-3
tools/slurm_test.sh
tools/slurm_test.sh
+3
-1
tools/slurm_train.sh
tools/slurm_train.sh
+4
-2
tools/train.py
tools/train.py
+17
-13
No files found.
configs/kitti/dv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py
View file @
e29eb2a5
...
@@ -93,7 +93,8 @@ class_names = ['Car']
...
@@ -93,7 +93,8 @@ class_names = ['Car']
img_norm_cfg
=
dict
(
img_norm_cfg
=
dict
(
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
input_modality
=
dict
(
input_modality
=
dict
(
use_lidar
=
True
,
use_lidar
=
False
,
use_lidar_reduced
=
True
,
use_depth
=
False
,
use_depth
=
False
,
use_lidar_intensity
=
True
,
use_lidar_intensity
=
True
,
use_camera
=
False
,
use_camera
=
False
,
...
...
configs/kitti/dv_second_secfpn_2x8_cosine_80e_kitti-3d-3class.py
View file @
e29eb2a5
...
@@ -113,7 +113,8 @@ class_names = ['Pedestrian', 'Cyclist', 'Car']
...
@@ -113,7 +113,8 @@ class_names = ['Pedestrian', 'Cyclist', 'Car']
img_norm_cfg
=
dict
(
img_norm_cfg
=
dict
(
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
input_modality
=
dict
(
input_modality
=
dict
(
use_lidar
=
True
,
use_lidar
=
False
,
use_lidar_reduced
=
True
,
use_depth
=
False
,
use_depth
=
False
,
use_lidar_intensity
=
True
,
use_lidar_intensity
=
True
,
use_camera
=
True
,
use_camera
=
True
,
...
...
configs/kitti/dv_second_secfpn_6x8_80e_kitti-3d-car.py
View file @
e29eb2a5
...
@@ -91,7 +91,8 @@ class_names = ['Car']
...
@@ -91,7 +91,8 @@ class_names = ['Car']
img_norm_cfg
=
dict
(
img_norm_cfg
=
dict
(
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
input_modality
=
dict
(
input_modality
=
dict
(
use_lidar
=
True
,
use_lidar
=
False
,
use_lidar_reduced
=
True
,
use_depth
=
False
,
use_depth
=
False
,
use_lidar_intensity
=
True
,
use_lidar_intensity
=
True
,
use_camera
=
True
,
use_camera
=
True
,
...
...
configs/kitti/hv_pointpillars_secfpn_6x8_160e_kitti-3d-car.py
View file @
e29eb2a5
...
@@ -90,7 +90,8 @@ class_names = ['Car']
...
@@ -90,7 +90,8 @@ class_names = ['Car']
img_norm_cfg
=
dict
(
img_norm_cfg
=
dict
(
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
input_modality
=
dict
(
input_modality
=
dict
(
use_lidar
=
True
,
use_lidar
=
False
,
use_lidar_reduced
=
True
,
use_depth
=
False
,
use_depth
=
False
,
use_lidar_intensity
=
True
,
use_lidar_intensity
=
True
,
use_camera
=
False
,
use_camera
=
False
,
...
...
configs/kitti/hv_second_secfpn_6x8_80e_kitti-3d-car.py
View file @
e29eb2a5
...
@@ -89,7 +89,8 @@ class_names = ['Car']
...
@@ -89,7 +89,8 @@ class_names = ['Car']
img_norm_cfg
=
dict
(
img_norm_cfg
=
dict
(
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
mean
=
[
123.675
,
116.28
,
103.53
],
std
=
[
58.395
,
57.12
,
57.375
],
to_rgb
=
True
)
input_modality
=
dict
(
input_modality
=
dict
(
use_lidar
=
True
,
use_lidar
=
False
,
use_lidar_reduced
=
True
,
use_depth
=
False
,
use_depth
=
False
,
use_lidar_intensity
=
True
,
use_lidar_intensity
=
True
,
use_camera
=
False
,
use_camera
=
False
,
...
...
mmdet3d/datasets/kitti_dataset.py
View file @
e29eb2a5
...
@@ -184,6 +184,8 @@ class KittiDataset(torch_data.Dataset):
...
@@ -184,6 +184,8 @@ class KittiDataset(torch_data.Dataset):
if
self
.
modality
[
'use_depth'
]
and
self
.
modality
[
'use_lidar'
]:
if
self
.
modality
[
'use_depth'
]
and
self
.
modality
[
'use_lidar'
]:
points
=
self
.
get_lidar_depth_reduced
(
sample_idx
)
points
=
self
.
get_lidar_depth_reduced
(
sample_idx
)
elif
self
.
modality
[
'use_lidar'
]:
elif
self
.
modality
[
'use_lidar'
]:
points
=
self
.
get_lidar
(
sample_idx
)
elif
self
.
modality
[
'use_lidar_reduced'
]:
points
=
self
.
get_lidar_reduced
(
sample_idx
)
points
=
self
.
get_lidar_reduced
(
sample_idx
)
elif
self
.
modality
[
'use_depth'
]:
elif
self
.
modality
[
'use_depth'
]:
points
=
self
.
get_pure_depth_reduced
(
sample_idx
)
points
=
self
.
get_pure_depth_reduced
(
sample_idx
)
...
...
mmdet3d/ops/sparse_block.py
View file @
e29eb2a5
from
mmcv.cnn
import
build_norm_layer
from
mmcv.cnn
import
build_norm_layer
from
torch
import
nn
from
torch
import
nn
import
mmdet3d.ops.spconv
as
spconv
from
.
import
spconv
from
mmdet.models.backbones.resnet
import
BasicBlock
,
Bottleneck
from
mmdet.models.backbones.resnet
import
BasicBlock
,
Bottleneck
...
...
tools/dist_test.sh
0 → 100755
View file @
e29eb2a5
#!/usr/bin/env bash
CONFIG
=
$1
CHECKPOINT
=
$2
GPUS
=
$3
PORT
=
${
PORT
:-
29500
}
PYTHONPATH
=
"
$(
dirname
$0
)
/.."
:
$PYTHONPATH
\
python
-m
torch.distributed.launch
--nproc_per_node
=
$GPUS
--master_port
=
$PORT
\
$(
dirname
"
$0
"
)
/test.py
$CONFIG
$CHECKPOINT
--launcher
pytorch
${
@
:4
}
tools/dist_train.sh
View file @
e29eb2a5
#!/usr/bin/env bash
#!/usr/bin/env bash
PYTHON
=
${
PYTHON
:-
"python"
}
CONFIG
=
$1
CONFIG
=
$1
GPUS
=
$2
GPUS
=
$2
PORT
=
${
PORT
:-
29500
}
$PYTHON
-m
torch.distributed.launch
--nproc_per_node
=
$GPUS
\
PYTHONPATH
=
"
$(
dirname
$0
)
/.."
:
$PYTHONPATH
\
python
-m
torch.distributed.launch
--nproc_per_node
=
$GPUS
--master_port
=
$PORT
\
$(
dirname
"
$0
"
)
/train.py
$CONFIG
--launcher
pytorch
${
@
:3
}
$(
dirname
"
$0
"
)
/train.py
$CONFIG
--launcher
pytorch
${
@
:3
}
tools/slurm_test.sh
View file @
e29eb2a5
#!/usr/bin/env bash
#!/usr/bin/env bash
set
-x
set
-x
export
PYTHONPATH
=
`
pwd
`
:
$PYTHONPATH
PARTITION
=
$1
PARTITION
=
$1
JOB_NAME
=
$2
JOB_NAME
=
$2
...
@@ -9,14 +8,17 @@ CONFIG=$3
...
@@ -9,14 +8,17 @@ CONFIG=$3
CHECKPOINT
=
$4
CHECKPOINT
=
$4
GPUS
=
${
GPUS
:-
8
}
GPUS
=
${
GPUS
:-
8
}
GPUS_PER_NODE
=
${
GPUS_PER_NODE
:-
8
}
GPUS_PER_NODE
=
${
GPUS_PER_NODE
:-
8
}
CPUS_PER_TASK
=
${
CPUS_PER_TASK
:-
5
}
PY_ARGS
=
${
@
:5
}
PY_ARGS
=
${
@
:5
}
SRUN_ARGS
=
${
SRUN_ARGS
:-
""
}
SRUN_ARGS
=
${
SRUN_ARGS
:-
""
}
PYTHONPATH
=
"
$(
dirname
$0
)
/.."
:
$PYTHONPATH
\
srun
-p
${
PARTITION
}
\
srun
-p
${
PARTITION
}
\
--job-name
=
${
JOB_NAME
}
\
--job-name
=
${
JOB_NAME
}
\
--gres
=
gpu:
${
GPUS_PER_NODE
}
\
--gres
=
gpu:
${
GPUS_PER_NODE
}
\
--ntasks
=
${
GPUS
}
\
--ntasks
=
${
GPUS
}
\
--ntasks-per-node
=
${
GPUS_PER_NODE
}
\
--ntasks-per-node
=
${
GPUS_PER_NODE
}
\
--cpus-per-task
=
${
CPUS_PER_TASK
}
\
--kill-on-bad-exit
=
1
\
--kill-on-bad-exit
=
1
\
${
SRUN_ARGS
}
\
${
SRUN_ARGS
}
\
python
-u
tools/test.py
${
CONFIG
}
${
CHECKPOINT
}
--launcher
=
"slurm"
${
PY_ARGS
}
python
-u
tools/test.py
${
CONFIG
}
${
CHECKPOINT
}
--launcher
=
"slurm"
${
PY_ARGS
}
tools/slurm_train.sh
View file @
e29eb2a5
...
@@ -8,15 +8,17 @@ CONFIG=$3
...
@@ -8,15 +8,17 @@ CONFIG=$3
WORK_DIR
=
$4
WORK_DIR
=
$4
GPUS
=
${
GPUS
:-
8
}
GPUS
=
${
GPUS
:-
8
}
GPUS_PER_NODE
=
${
GPUS_PER_NODE
:-
8
}
GPUS_PER_NODE
=
${
GPUS_PER_NODE
:-
8
}
CPUS_PER_TASK
=
${
CPUS_PER_TASK
:-
5
}
SRUN_ARGS
=
${
SRUN_ARGS
:-
""
}
SRUN_ARGS
=
${
SRUN_ARGS
:-
""
}
PY_ARGS
=
${
PY_ARGS
:-
"--validate"
}
PY_ARGS
=
${
@
:5
}
PYTHONPATH
=
"
$(
dirname
$0
)
/.."
:
$PYTHONPATH
\
srun
-p
${
PARTITION
}
\
srun
-p
${
PARTITION
}
\
--job-name
=
${
JOB_NAME
}
\
--job-name
=
${
JOB_NAME
}
\
--gres
=
gpu:
${
GPUS_PER_NODE
}
\
--gres
=
gpu:
${
GPUS_PER_NODE
}
\
--ntasks
=
${
GPUS
}
\
--ntasks
=
${
GPUS
}
\
--ntasks-per-node
=
${
GPUS_PER_NODE
}
\
--ntasks-per-node
=
${
GPUS_PER_NODE
}
\
--cpus-per-task
=
${
CPUS_PER_TASK
}
\
--kill-on-bad-exit
=
1
\
--kill-on-bad-exit
=
1
\
${
SRUN_ARGS
}
\
${
SRUN_ARGS
}
\
python
-u
tools/train.py
${
CONFIG
}
--work-dir
=
${
WORK_DIR
}
--launcher
=
"slurm"
${
PY_ARGS
}
python
-u
tools/train.py
${
CONFIG
}
--work-dir
=
${
WORK_DIR
}
--launcher
=
"slurm"
${
PY_ARGS
}
tools/train.py
View file @
e29eb2a5
...
@@ -8,7 +8,7 @@ import time
...
@@ -8,7 +8,7 @@ import time
import
mmcv
import
mmcv
import
torch
import
torch
from
mmcv
import
Config
from
mmcv
import
Config
,
DictAction
from
mmcv.runner
import
init_dist
from
mmcv.runner
import
init_dist
from
mmdet3d
import
__version__
from
mmdet3d
import
__version__
...
@@ -26,9 +26,9 @@ def parse_args():
...
@@ -26,9 +26,9 @@ def parse_args():
parser
.
add_argument
(
parser
.
add_argument
(
'--resume-from'
,
help
=
'the checkpoint file to resume from'
)
'--resume-from'
,
help
=
'the checkpoint file to resume from'
)
parser
.
add_argument
(
parser
.
add_argument
(
'--validate'
,
'--
no-
validate'
,
action
=
'store_true'
,
action
=
'store_true'
,
help
=
'whether to evaluate the checkpoint during training'
)
help
=
'whether
not
to evaluate the checkpoint during training'
)
group_gpus
=
parser
.
add_mutually_exclusive_group
()
group_gpus
=
parser
.
add_mutually_exclusive_group
()
group_gpus
.
add_argument
(
group_gpus
.
add_argument
(
'--gpus'
,
'--gpus'
,
...
@@ -46,6 +46,8 @@ def parse_args():
...
@@ -46,6 +46,8 @@ def parse_args():
'--deterministic'
,
'--deterministic'
,
action
=
'store_true'
,
action
=
'store_true'
,
help
=
'whether to set deterministic options for CUDNN backend.'
)
help
=
'whether to set deterministic options for CUDNN backend.'
)
parser
.
add_argument
(
'--options'
,
nargs
=
'+'
,
action
=
DictAction
,
help
=
'arguments in dict'
)
parser
.
add_argument
(
parser
.
add_argument
(
'--launcher'
,
'--launcher'
,
choices
=
[
'none'
,
'pytorch'
,
'slurm'
,
'mpi'
],
choices
=
[
'none'
,
'pytorch'
,
'slurm'
,
'mpi'
],
...
@@ -67,6 +69,9 @@ def main():
...
@@ -67,6 +69,9 @@ def main():
args
=
parse_args
()
args
=
parse_args
()
cfg
=
Config
.
fromfile
(
args
.
config
)
cfg
=
Config
.
fromfile
(
args
.
config
)
if
args
.
options
is
not
None
:
cfg
.
merge_from_dict
(
args
.
options
)
# set cudnn_benchmark
# set cudnn_benchmark
if
cfg
.
get
(
'cudnn_benchmark'
,
False
):
if
cfg
.
get
(
'cudnn_benchmark'
,
False
):
torch
.
backends
.
cudnn
.
benchmark
=
True
torch
.
backends
.
cudnn
.
benchmark
=
True
...
@@ -101,7 +106,7 @@ def main():
...
@@ -101,7 +106,7 @@ def main():
mmcv
.
mkdir_or_exist
(
osp
.
abspath
(
cfg
.
work_dir
))
mmcv
.
mkdir_or_exist
(
osp
.
abspath
(
cfg
.
work_dir
))
# init the logger before other steps
# init the logger before other steps
timestamp
=
time
.
strftime
(
'%Y%m%d_%H%M%S'
,
time
.
localtime
())
timestamp
=
time
.
strftime
(
'%Y%m%d_%H%M%S'
,
time
.
localtime
())
log_file
=
osp
.
join
(
cfg
.
work_dir
,
'{
}.log'
.
format
(
timestamp
)
)
log_file
=
osp
.
join
(
cfg
.
work_dir
,
f
'
{
timestamp
}
.log'
)
logger
=
get_root_logger
(
log_file
=
log_file
,
log_level
=
cfg
.
log_level
)
logger
=
get_root_logger
(
log_file
=
log_file
,
log_level
=
cfg
.
log_level
)
# add a logging filter
# add a logging filter
...
@@ -113,28 +118,27 @@ def main():
...
@@ -113,28 +118,27 @@ def main():
meta
=
dict
()
meta
=
dict
()
# log env info
# log env info
env_info_dict
=
collect_env
()
env_info_dict
=
collect_env
()
env_info
=
'
\n
'
.
join
([(
'{}: {}'
.
format
(
k
,
v
))
env_info
=
'
\n
'
.
join
([(
f
'
{
k
}
:
{
v
}
'
)
for
k
,
v
in
env_info_dict
.
items
()])
for
k
,
v
in
env_info_dict
.
items
()])
dash_line
=
'-'
*
60
+
'
\n
'
dash_line
=
'-'
*
60
+
'
\n
'
logger
.
info
(
'Environment info:
\n
'
+
dash_line
+
env_info
+
'
\n
'
+
logger
.
info
(
'Environment info:
\n
'
+
dash_line
+
env_info
+
'
\n
'
+
dash_line
)
dash_line
)
meta
[
'env_info'
]
=
env_info
meta
[
'env_info'
]
=
env_info
# log some basic info
# log some basic info
logger
.
info
(
'Distributed training: {
}'
.
format
(
distributed
)
)
logger
.
info
(
f
'Distributed training:
{
distributed
}
'
)
logger
.
info
(
'Config:
\n
{
}'
.
format
(
cfg
.
text
)
)
logger
.
info
(
f
'Config:
\n
{
cfg
.
pretty_
text
}
'
)
# set random seeds
# set random seeds
if
args
.
seed
is
not
None
:
if
args
.
seed
is
not
None
:
logger
.
info
(
'Set random seed to {
}, deterministic: {}'
.
format
(
logger
.
info
(
f
'Set random seed to
{
args
.
seed
}
, '
args
.
seed
,
args
.
deterministic
)
)
f
'deterministic:
{
args
.
deterministic
}
'
)
set_random_seed
(
args
.
seed
,
deterministic
=
args
.
deterministic
)
set_random_seed
(
args
.
seed
,
deterministic
=
args
.
deterministic
)
cfg
.
seed
=
args
.
seed
cfg
.
seed
=
args
.
seed
meta
[
'seed'
]
=
args
.
seed
meta
[
'seed'
]
=
args
.
seed
model
=
build_detector
(
model
=
build_detector
(
cfg
.
model
,
train_cfg
=
cfg
.
train_cfg
,
test_cfg
=
cfg
.
test_cfg
)
cfg
.
model
,
train_cfg
=
cfg
.
train_cfg
,
test_cfg
=
cfg
.
test_cfg
)
logger
.
info
(
'Model:
\n
{
}'
.
format
(
model
)
)
logger
.
info
(
f
'Model:
\n
{
model
}
'
)
datasets
=
[
build_dataset
(
cfg
.
data
.
train
)]
datasets
=
[
build_dataset
(
cfg
.
data
.
train
)]
if
len
(
cfg
.
workflow
)
==
2
:
if
len
(
cfg
.
workflow
)
==
2
:
val_dataset
=
copy
.
deepcopy
(
cfg
.
data
.
val
)
val_dataset
=
copy
.
deepcopy
(
cfg
.
data
.
val
)
...
@@ -145,7 +149,7 @@ def main():
...
@@ -145,7 +149,7 @@ def main():
# checkpoints as meta data
# checkpoints as meta data
cfg
.
checkpoint_config
.
meta
=
dict
(
cfg
.
checkpoint_config
.
meta
=
dict
(
mmdet_version
=
__version__
,
mmdet_version
=
__version__
,
config
=
cfg
.
text
,
config
=
cfg
.
pretty_
text
,
CLASSES
=
datasets
[
0
].
CLASSES
)
CLASSES
=
datasets
[
0
].
CLASSES
)
# add an attribute for visualization convenience
# add an attribute for visualization convenience
model
.
CLASSES
=
datasets
[
0
].
CLASSES
model
.
CLASSES
=
datasets
[
0
].
CLASSES
...
@@ -154,7 +158,7 @@ def main():
...
@@ -154,7 +158,7 @@ def main():
datasets
,
datasets
,
cfg
,
cfg
,
distributed
=
distributed
,
distributed
=
distributed
,
validate
=
args
.
validate
,
validate
=
(
not
args
.
no_
validate
)
,
timestamp
=
timestamp
,
timestamp
=
timestamp
,
meta
=
meta
)
meta
=
meta
)
...
...
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