Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
aa20f1c4
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
aa20f1c4
编写于
8月 31, 2020
作者:
M
mindspore-ci-bot
提交者:
Gitee
8月 31, 2020
浏览文件
操作
浏览文件
下载
差异文件
!5558 thor optimizer training parameters for GPU
Merge pull request !5558 from wangmin0104/master
上级
f3bc9b2f
9748a3d2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
12 deletion
+21
-12
model_zoo/official/cv/resnet_thor/scripts/run_distribute_train.sh
...o/official/cv/resnet_thor/scripts/run_distribute_train.sh
+14
-6
model_zoo/official/cv/resnet_thor/src/config.py
model_zoo/official/cv/resnet_thor/src/config.py
+6
-6
model_zoo/official/cv/resnet_thor/train.py
model_zoo/official/cv/resnet_thor/train.py
+1
-0
未找到文件。
model_zoo/official/cv/resnet_thor/scripts/run_distribute_train.sh
浏览文件 @
aa20f1c4
...
...
@@ -32,13 +32,21 @@ then
exit
1
fi
BASE_PATH
=
$(
cd
"
`
dirname
$0
`
"
||
exit
;
pwd
)
cd
$BASE_PATH
/../
||
exit
get_real_path
(){
if
[
"
${
1
:0:1
}
"
==
"/"
]
;
then
echo
"
$1
"
else
echo
"
$(
realpath
-m
$PWD
/
$1
)
"
fi
}
PATH1
=
$(
get_real_path
$1
)
PATH2
=
$(
get_real_path
$2
)
ulimit
-u
unlimited
export
DEVICE_NUM
=
$3
export
RANK_SIZE
=
$3
export
RANK_TABLE_FILE
=
$1
export
RANK_TABLE_FILE
=
$
PATH
1
for
((
i
=
0
;
i<
${
DEVICE_NUM
}
;
i++
))
do
...
...
@@ -46,12 +54,12 @@ do
export
RANK_ID
=
$i
rm
-rf
./train_parallel
$i
mkdir
./train_parallel
$i
cp
*
.py ./train_parallel
$i
cp
-r
./src ./train_parallel
$i
cp
../
*
.py ./train_parallel
$i
cp
-r
.
.
/src ./train_parallel
$i
cd
./train_parallel
$i
||
exit
echo
"start training for rank
$RANK_ID
, device
$DEVICE_ID
"
env
>
env.log
python train.py
--run_distribute
=
True
--device_num
=
$DEVICE_NUM
--dataset_path
=
$2
>
log 2>&1 &
python train.py
--run_distribute
=
True
--device_num
=
$DEVICE_NUM
--dataset_path
=
$
PATH
2
>
log 2>&1 &
cd
..
done
model_zoo/official/cv/resnet_thor/src/config.py
浏览文件 @
aa20f1c4
...
...
@@ -46,17 +46,17 @@ config_gpu = ed({
"loss_scale"
:
128
,
"momentum"
:
0.9
,
"weight_decay"
:
5e-4
,
"epoch_size"
:
4
5
,
"epoch_size"
:
4
0
,
"save_checkpoint"
:
True
,
"save_checkpoint_epochs"
:
1
,
"keep_checkpoint_max"
:
15
,
"save_checkpoint_path"
:
"./"
,
"use_label_smooth"
:
True
,
"label_smooth_factor"
:
0.1
,
"lr_init"
:
0.0
4
,
"lr_decay"
:
5
,
"lr_end_epoch"
:
5
8
,
"damping_init"
:
0.02
,
"damping_decay"
:
0.
8
7
,
"lr_init"
:
0.0
5672
,
"lr_decay"
:
4.9687
,
"lr_end_epoch"
:
5
0
,
"damping_init"
:
0.02
345
,
"damping_decay"
:
0.
546
7
,
"frequency"
:
834
,
})
model_zoo/official/cv/resnet_thor/train.py
浏览文件 @
aa20f1c4
...
...
@@ -109,6 +109,7 @@ if __name__ == '__main__':
init
()
context
.
set_auto_parallel_context
(
device_num
=
get_group_size
(),
parallel_mode
=
ParallelMode
.
DATA_PARALLEL
,
mirror_mean
=
True
)
auto_parallel_context
().
set_all_reduce_fusion_split_indices
([
107
])
ckpt_save_dir
=
config
.
save_checkpoint_path
+
"ckpt_"
+
str
(
get_rank
())
+
"/"
# create dataset
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录