Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
221cb0332
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
221cb0332
Commits
25326e4e
Commit
25326e4e
authored
3 years ago
by
zhouneng
Browse files
Options
Downloads
Patches
Plain Diff
[yolov3_darknet53]bind cpu cores to speed up training
parent
952fd47d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
official/cv/yolov3_darknet53/scripts/run_standalone_train.sh
+13
-1
13 additions, 1 deletion
official/cv/yolov3_darknet53/scripts/run_standalone_train.sh
official/cv/yolov3_darknet53/src/yolo_dataset.py
+0
-1
0 additions, 1 deletion
official/cv/yolov3_darknet53/src/yolo_dataset.py
with
13 additions
and
2 deletions
official/cv/yolov3_darknet53/scripts/run_standalone_train.sh
+
13
−
1
View file @
25326e4e
...
...
@@ -49,6 +49,7 @@ export DEVICE_NUM=1
export
DEVICE_ID
=
0
export
RANK_ID
=
0
export
RANK_SIZE
=
1
export
CPU_BIND_NUM
=
24
if
[
-d
"train"
]
;
then
...
...
@@ -63,7 +64,18 @@ cd ./train || exit
echo
"start training for device
$DEVICE_ID
"
env
>
env.log
python train.py
\
cpus
=
`
cat
/proc/cpuinfo|
grep
"processor"
|
wc
-l
`
if
[
$cpus
-ge
$CPU_BIND_NUM
]
then
start
=
`
expr
$cpus
-
$CPU_BIND_NUM
`
end
=
`
expr
$cpus
- 1
`
else
start
=
0
end
=
`
expr
$cpus
- 1
`
fi
cmdopt
=
$start
"-"
$end
taskset
-c
$cmdopt
python train.py
\
--data_dir
=
$DATASET_PATH
\
--pretrained_backbone
=
$PRETRAINED_BACKBONE
\
--is_distributed
=
0
\
...
...
This diff is collapsed.
Click to expand it.
official/cv/yolov3_darknet53/src/yolo_dataset.py
+
0
−
1
View file @
25326e4e
...
...
@@ -167,7 +167,6 @@ def create_yolo_dataset(image_dir, anno_path, batch_size, max_epoch, device_num,
"
gt_box1
"
,
"
gt_box2
"
,
"
gt_box3
"
]
if
device_num
!=
8
:
ds
=
de
.
GeneratorDataset
(
yolo_dataset
,
column_names
=
dataset_column_names
,
num_parallel_workers
=
min
(
32
,
num_parallel_workers
),
sampler
=
distributed_sampler
)
ds
=
ds
.
batch
(
batch_size
,
per_batch_map
=
multi_scale_trans
,
input_columns
=
dataset_column_names
,
num_parallel_workers
=
min
(
32
,
num_parallel_workers
),
drop_remainder
=
True
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment