Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
9f50195b
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9f50195b
编写于
1月 19, 2018
作者:
T
typhoonzero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update using cifar10
上级
311d159e
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
20 addition
and
12 deletion
+20
-12
benchmark/cluster/v2/Dockerfile
benchmark/cluster/v2/Dockerfile
+4
-4
benchmark/cluster/v2/reader.py
benchmark/cluster/v2/reader.py
+1
-1
benchmark/cluster/v2/vgg16.py
benchmark/cluster/v2/vgg16.py
+15
-7
未找到文件。
benchmark/cluster/v2/Dockerfile
浏览文件 @
9f50195b
FROM
paddlepaddle/paddlecloud-job
RUN
mkdir
-p
/workspace
&&
mkdir
-p
/root/.cache/paddle/dataset/flowers/
ADD
vgg16.py
reader.py /workspace/
COPY
102flowers.tgz imagelabels.mat setid.mat /root/.cache/paddle/dataset/flowers/
RUN
mkdir
-p
/workspace
ADD
reader.py /workspace/
RUN
python /workspace/reader.py
ADD
vgg16.py /workspace/
benchmark/cluster/v2/reader.py
浏览文件 @
9f50195b
...
...
@@ -67,4 +67,4 @@ if __name__ == '__main__':
# print len(im[0])
#for im in train_reader('test.list'):
# print len(im[0])
paddle
.
dataset
.
flowers
.
train
()
paddle
.
dataset
.
cifar
.
train10
()
benchmark/cluster/v2/vgg16.py
浏览文件 @
9f50195b
...
...
@@ -14,13 +14,15 @@
import
gzip
import
paddle.v2.dataset.
flowers
as
flowers
import
paddle.v2.dataset.
cifar
as
cifar
import
paddle.v2
as
paddle
import
reader
import
time
DATA_DIM
=
3
*
224
*
224
# Use 3 * 331 * 331 or 3 * 299 * 299 for Inception-ResNet-v2.
CLASS_DIM
=
10
2
DATA_DIM
=
3
*
32
*
32
CLASS_DIM
=
10
BATCH_SIZE
=
128
ts
=
0
def
vgg
(
input
,
nums
,
class_dim
):
...
...
@@ -74,6 +76,7 @@ def vgg19(input, class_dim):
def
main
():
global
ts
paddle
.
init
(
use_gpu
=
False
,
trainer_count
=
1
)
image
=
paddle
.
layer
.
data
(
name
=
"image"
,
type
=
paddle
.
data_type
.
dense_vector
(
DATA_DIM
))
...
...
@@ -100,13 +103,13 @@ def main():
train_reader
=
paddle
.
batch
(
paddle
.
reader
.
shuffle
(
flowers
.
train
(),
cifar
.
train10
(),
# To use other data, replace the above line with:
# reader.train_reader('train.list'),
buf_size
=
1000
),
batch_size
=
BATCH_SIZE
)
test_reader
=
paddle
.
batch
(
flowers
.
valid
(),
cifar
.
test10
(),
# To use other data, replace the above line with:
# reader.test_reader('val.list'),
batch_size
=
BATCH_SIZE
)
...
...
@@ -120,10 +123,14 @@ def main():
# End batch and end pass event handler
def
event_handler
(
event
):
global
ts
if
isinstance
(
event
,
paddle
.
event
.
BeginIteration
):
ts
=
time
.
time
()
if
isinstance
(
event
,
paddle
.
event
.
EndIteration
):
if
event
.
batch_id
%
1
==
0
:
print
"
\n
Pass %d, Batch %d, Cost %f, %s"
%
(
event
.
pass_id
,
event
.
batch_id
,
event
.
cost
,
event
.
metrics
)
print
"
\n
Pass %d, Batch %d, Cost %f, %s, spent: %f"
%
(
event
.
pass_id
,
event
.
batch_id
,
event
.
cost
,
event
.
metrics
,
time
.
time
()
-
ts
)
if
isinstance
(
event
,
paddle
.
event
.
EndPass
):
with
gzip
.
open
(
'params_pass_%d.tar.gz'
%
event
.
pass_id
,
'w'
)
as
f
:
trainer
.
save_parameter_to_tar
(
f
)
...
...
@@ -137,3 +144,4 @@ def main():
if
__name__
==
'__main__'
:
main
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录