Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSlim
提交
a6f42259
P
PaddleSlim
项目概览
PaddlePaddle
/
PaddleSlim
接近 2 年 前同步成功
通知
51
Star
1434
Fork
344
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
16
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSlim
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
16
合并请求
16
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
a6f42259
编写于
7月 05, 2021
作者:
M
minghaoBD
提交者:
GitHub
7月 05, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix imagenet reader, test=develop (#835)
* fix imagenet reader, test=develop * update unstructuredPruner accordingly
上级
10e7c2da
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
15 deletion
+2
-15
demo/dygraph/unstructured_pruning/train.py
demo/dygraph/unstructured_pruning/train.py
+1
-1
demo/imagenet_reader.py
demo/imagenet_reader.py
+1
-14
未找到文件。
demo/dygraph/unstructured_pruning/train.py
浏览文件 @
a6f42259
...
...
@@ -191,7 +191,7 @@ def compress(args):
opt
.
clear_grad
()
pruner
.
step
()
train_run_cost
+=
time
.
time
()
-
train_start
total_samples
+=
args
.
batch_size
*
ParallelEnv
().
nranks
total_samples
+=
args
.
batch_size
if
batch_id
%
args
.
log_period
==
0
:
_logger
.
info
(
...
...
demo/imagenet_reader.py
浏览文件 @
a6f42259
...
...
@@ -144,20 +144,7 @@ def _reader_creator(file_list,
full_lines
=
[
line
.
strip
()
for
line
in
flist
]
if
shuffle
:
np
.
random
.
shuffle
(
full_lines
)
if
mode
==
'train'
and
os
.
getenv
(
'PADDLE_TRAINING_ROLE'
):
# distributed mode if the env var `PADDLE_TRAINING_ROLE` exits
trainer_id
=
int
(
os
.
getenv
(
"PADDLE_TRAINER_ID"
,
"0"
))
trainer_count
=
int
(
os
.
getenv
(
"PADDLE_TRAINERS_NUM"
,
"1"
))
per_node_lines
=
len
(
full_lines
)
//
trainer_count
lines
=
full_lines
[
trainer_id
*
per_node_lines
:(
trainer_id
+
1
)
*
per_node_lines
]
print
(
"read images from %d, length: %d, lines length: %d, total: %d"
%
(
trainer_id
*
per_node_lines
,
per_node_lines
,
len
(
lines
),
len
(
full_lines
)))
else
:
lines
=
full_lines
lines
=
full_lines
for
line
in
lines
:
if
mode
==
'train'
or
mode
==
'val'
:
img_path
,
label
=
line
.
split
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录