Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
9056ed1d
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看板
提交
9056ed1d
编写于
8月 31, 2020
作者:
Z
zhouyaqiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug of make file fail if not root user
上级
93a50ec4
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
13 deletion
+13
-13
model_zoo/densenet121/README.md
model_zoo/densenet121/README.md
+1
-1
model_zoo/densenet121/eval.py
model_zoo/densenet121/eval.py
+10
-10
model_zoo/densenet121/scripts/run_distribute_train.sh
model_zoo/densenet121/scripts/run_distribute_train.sh
+2
-2
未找到文件。
model_zoo/densenet121/README.md
浏览文件 @
9056ed1d
...
...
@@ -168,7 +168,7 @@ You can modify the training behaviour through the various flags in the `train.py
-
running on Ascend
```
python train.py --data_dir /PATH/TO/DATASET --is_distributed 0> train.log 2>&1 &
python train.py --data_dir /PATH/TO/DATASET --is_distributed 0
> train.log 2>&1 &
```
The python command above will run in the background, The log and model checkpoint will be generated in
`output/202x-xx-xx_time_xx_xx_xx/`
. The loss value will be achieved as follows:
...
...
model_zoo/densenet121/eval.py
浏览文件 @
9056ed1d
...
...
@@ -190,21 +190,21 @@ def test(cloud_args=None):
args
.
logger
.
info
(
'before results={}'
.
format
(
results
))
if
args
.
is_distributed
:
model_md5
=
model
.
replace
(
'/'
,
''
)
tmp_dir
=
'/cache'
tmp_dir
=
'
..
/cache'
if
not
os
.
path
.
exists
(
tmp_dir
):
os
.
mkdir
(
tmp_dir
)
top1_correct_npy
=
'
/cache/top1_rank_{}_{}.npy'
.
format
(
args
.
rank
,
model_md5
)
top5_correct_npy
=
'
/cache/top5_rank_{}_{}.npy'
.
format
(
args
.
rank
,
model_md5
)
img_tot_npy
=
'
/cache/img_tot_rank_{}_{}.npy'
.
format
(
args
.
rank
,
model_md5
)
top1_correct_npy
=
'
{}/top1_rank_{}_{}.npy'
.
format
(
tmp_dir
,
args
.
rank
,
model_md5
)
top5_correct_npy
=
'
{}/top5_rank_{}_{}.npy'
.
format
(
tmp_dir
,
args
.
rank
,
model_md5
)
img_tot_npy
=
'
{}/img_tot_rank_{}_{}.npy'
.
format
(
tmp_dir
,
args
.
rank
,
model_md5
)
np
.
save
(
top1_correct_npy
,
top1_correct
)
np
.
save
(
top5_correct_npy
,
top5_correct
)
np
.
save
(
img_tot_npy
,
img_tot
)
while
True
:
rank_ok
=
True
for
other_rank
in
range
(
args
.
group_size
):
top1_correct_npy
=
'
/cache/top1_rank_{}_{}.npy'
.
format
(
other_rank
,
model_md5
)
top5_correct_npy
=
'
/cache/top5_rank_{}_{}.npy'
.
format
(
other_rank
,
model_md5
)
img_tot_npy
=
'
/cache/img_tot_rank_{}_{}.npy'
.
format
(
other_rank
,
model_md5
)
top1_correct_npy
=
'
{}/top1_rank_{}_{}.npy'
.
format
(
tmp_dir
,
other_rank
,
model_md5
)
top5_correct_npy
=
'
{}/top5_rank_{}_{}.npy'
.
format
(
tmp_dir
,
other_rank
,
model_md5
)
img_tot_npy
=
'
{}/img_tot_rank_{}_{}.npy'
.
format
(
tmp_dir
,
other_rank
,
model_md5
)
if
not
os
.
path
.
exists
(
top1_correct_npy
)
or
not
os
.
path
.
exists
(
top5_correct_npy
)
\
or
not
os
.
path
.
exists
(
img_tot_npy
):
rank_ok
=
False
...
...
@@ -215,9 +215,9 @@ def test(cloud_args=None):
top5_correct_all
=
0
img_tot_all
=
0
for
other_rank
in
range
(
args
.
group_size
):
top1_correct_npy
=
'
/cache/top1_rank_{}_{}.npy'
.
format
(
other_rank
,
model_md5
)
top5_correct_npy
=
'
/cache/top5_rank_{}_{}.npy'
.
format
(
other_rank
,
model_md5
)
img_tot_npy
=
'
/cache/img_tot_rank_{}_{}.npy'
.
format
(
other_rank
,
model_md5
)
top1_correct_npy
=
'
{}/top1_rank_{}_{}.npy'
.
format
(
tmp_dir
,
other_rank
,
model_md5
)
top5_correct_npy
=
'
{}/top5_rank_{}_{}.npy'
.
format
(
tmp_dir
,
other_rank
,
model_md5
)
img_tot_npy
=
'
{}/img_tot_rank_{}_{}.npy'
.
format
(
tmp_dir
,
other_rank
,
model_md5
)
top1_correct_all
+=
np
.
load
(
top1_correct_npy
)
top5_correct_all
+=
np
.
load
(
top5_correct_npy
)
img_tot_all
+=
np
.
load
(
img_tot_npy
)
...
...
model_zoo/densenet121/scripts/run_distribute_train.sh
浏览文件 @
9056ed1d
...
...
@@ -16,8 +16,8 @@
echo
"=============================================================================================================="
echo
"Please run the scipt as: "
echo
"sh run_distribute_train.sh DEVICE_NUM RANK_TABLE_FILE DATASET"
echo
"for example: sh run_distribute_train.sh 8 /data/hccl.json /path/to/dataset"
echo
"sh
scipts/
run_distribute_train.sh DEVICE_NUM RANK_TABLE_FILE DATASET"
echo
"for example: sh
scipts/
run_distribute_train.sh 8 /data/hccl.json /path/to/dataset"
echo
"It is better to use absolute path."
echo
"================================================================================================================="
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录