Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
docs
提交
28340e25
D
docs
项目概览
MindSpore
/
docs
通知
4
Star
2
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
28340e25
编写于
9月 03, 2020
作者:
J
JunYuLiu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add tools
上级
5deb5345
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
119 addition
and
4 deletion
+119
-4
tools/link_detection/README_CN.md
tools/link_detection/README_CN.md
+1
-1
tools/pic_detection/README_CN.md
tools/pic_detection/README_CN.md
+27
-0
tools/pic_detection/pic_detection.py
tools/pic_detection/pic_detection.py
+88
-0
tutorials/notebook/mindinsight/images/summary_list.png
tutorials/notebook/mindinsight/images/summary_list.png
+0
-0
tutorials/source_zh_cn/advanced_use/optimize_the_performance_of_data_preparation.md
...anced_use/optimize_the_performance_of_data_preparation.md
+2
-2
tutorials/source_zh_cn/advanced_use/second_order_optimizer_for_resnet50_application.md
...ed_use/second_order_optimizer_for_resnet50_application.md
+1
-1
未找到文件。
tools/link_detection/README_CN.md
浏览文件 @
28340e25
...
...
@@ -21,7 +21,7 @@
cd tools/link_detection
pip install requests
```
3.
在
`link_
check
`
目录下执行如下命令,在输入需要检测目录的绝对路径后,开始进行检测,完成后会在当前目录下新建
`404.txt`
、
`exception.txt`
、
`slow.txt`
三个文件。
3.
在
`link_
detection
`
目录下执行如下命令,在输入需要检测目录的绝对路径后,开始进行检测,完成后会在当前目录下新建
`404.txt`
、
`exception.txt`
、
`slow.txt`
三个文件。
```
python link_detection.py
```
...
...
tools/pic_detection/README_CN.md
0 → 100644
浏览文件 @
28340e25
# 图片检查工具
## 简介
此工具可以检查用户指定目录里所有图片的使用情况,会检查出没有使用的图片,并且将没有使用的图片删除。
## 使用说明
该工具所依赖的操作系统为Windows操作系统,执行环境为Python环境,具体使用步骤如下所示:
1.
打开Git Bash,下载MindSpore Docs仓代码。
```
git clone https://gitee.com/mindspore/docs.git
```
2.
进入
`tools/pic_detection`
目录。
```
cd tools/pic_detection
```
3.
在
`pic_detection`
目录下执行如下命令,在输入需要检测目录的绝对路径后,开始进行检测,最后将没有使用的图片删除。
```
python pic_detection.py
```
> 检测目录的绝对路径全使用英文,并且使用Linux的绝对路径方式,例如:`/d/master/docs`。
tools/pic_detection/pic_detection.py
0 → 100644
浏览文件 @
28340e25
import
subprocess
import
os
def
get_images_dierctory
(
check_path
):
'''
get all images directory.
'''
cmd
=
'find %s -type d -name images'
%
check_path
res
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
dir_list
=
res
.
stdout
.
read
().
decode
(
'utf-8'
).
split
(
'
\n
'
)
del
dir_list
[
-
1
]
return
dir_list
def
get_all_pic
(
dir_list
):
'''
get all the images in the images directory.
'''
for
dir
in
dir_list
:
res
=
subprocess
.
Popen
(
'ls %s'
%
dir
,
shell
=
True
,
stderr
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
pic_list
=
res
.
stdout
.
read
().
decode
(
'utf-8'
).
split
(
'
\n
'
)
del
pic_list
[
-
1
]
for
i
in
pic_list
:
pic_all
.
add
(
i
)
def
get_use_pic
(
check_path
):
'''
get all the useful pictures.
'''
cmd1
=
'find %s -type f -name "*.md"'
%
check_path
cmd2
=
'find %s -type f -name "*.ipynb"'
%
check_path
cmd3
=
[
cmd1
,
cmd2
]
for
i
in
cmd3
:
res
=
subprocess
.
Popen
(
i
,
shell
=
True
,
stderr
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
file_list
=
res
.
stdout
.
read
().
decode
(
'utf-8'
).
split
(
'
\n
'
)
del
file_list
[
-
1
]
for
j
in
file_list
:
j
=
j
.
split
(
'/'
,
1
)[
1
].
replace
(
'/'
,
':/'
,
1
)
with
open
(
j
,
'r'
,
encoding
=
'utf-8'
)
as
f
:
data
=
f
.
read
()
for
k
in
pic_all
:
if
k
in
data
:
use_pic
.
add
(
k
)
def
get_use_eddx
():
'''
get all the useful eddx files.
'''
for
i
in
filter_pic
:
if
i
.
endswith
(
'eddx'
):
if
i
.
split
(
'.'
)[
0
]
in
' '
.
join
(
use_pic
):
use_eddx
.
add
(
i
)
def
get_useless_pic_path
(
check_path
):
'''
get the absolute path of all useless pictures.
'''
for
i
in
useless_pic
:
cmd
=
'find %s -type f -name %s'
%
(
check_path
,
i
)
res
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
data
=
res
.
stdout
.
read
().
decode
(
'utf-8'
).
split
(
'
\n
'
)
del
data
[
-
1
]
for
j
in
data
:
path
.
append
(
j
)
def
del_useless_pic
():
'''
delete all useless pictures.
'''
for
i
in
path
:
os
.
system
(
'rm -rf %s'
%
i
)
if
__name__
==
'__main__'
:
check_path
=
input
(
'请输入您要检测的绝对路径:'
).
strip
()
pic_all
=
set
()
use_pic
=
set
()
use_eddx
=
set
()
path
=
[]
dir_list
=
get_images_dierctory
(
check_path
)
get_all_pic
(
dir_list
)
get_use_pic
(
check_path
)
filter_pic
=
pic_all
.
difference
(
use_pic
)
get_use_eddx
()
useless_pic
=
filter_pic
.
difference
(
use_eddx
)
get_useless_pic_path
(
check_path
)
print
(
'没有用的照片:'
,
path
)
del_useless_pic
()
print
(
'删除成功'
)
tutorials/notebook/mindinsight/images/summary_list.png
已删除
100644 → 0
浏览文件 @
5deb5345
32.9 KB
tutorials/source_zh_cn/advanced_use/optimize_the_performance_of_data_preparation.md
浏览文件 @
28340e25
...
...
@@ -251,9 +251,9 @@ shuffle性能优化建议如下:
for data in ds2.create_dict_iterator():
print(data["data"])
```
```
输出:
输出:
```
before shuffle:
[0 1 2 3 4]
[1 2 3 4 5]
...
...
tutorials/source_zh_cn/advanced_use/second_order_optimizer_for_resnet50_application.md
浏览文件 @
28340e25
...
...
@@ -351,7 +351,7 @@ epoch: 42 step: 5004, loss is 1.6453942
其中,
`*.ckpt`
:指保存的模型参数文件。checkpoint文件名称具体含义:
*网络名称*
-
*epoch数*
_
*step数*
.ckpt。
####
#
GPU
#### GPU
在GPU硬件平台上,MindSpore采用OpenMPI的
`mpirun`
进行分布式训练,进程创建1个目录,目录名称为
`train_parallel`
,用来保存日志信息和训练的checkpoint文件。下面以使用8张卡的分布式训练脚本为例,演示如何运行脚本:
```
sh run_distribute_train_gpu.sh [DATASET_PATH] [DEVICE_NUM]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录