Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
83f263e6
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
83f263e6
编写于
7月 17, 2017
作者:
Y
Yancey
提交者:
GitHub
7月 17, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix fetch record from master failed (#2848)
Fix fetch record from master
上级
1032ef18
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
5 deletion
+15
-5
go/cmd/master/master.go
go/cmd/master/master.go
+11
-3
python/paddle/v2/dataset/common.py
python/paddle/v2/dataset/common.py
+4
-2
未找到文件。
go/cmd/master/master.go
浏览文件 @
83f263e6
...
@@ -11,6 +11,7 @@ import (
...
@@ -11,6 +11,7 @@ import (
"github.com/namsral/flag"
"github.com/namsral/flag"
log
"github.com/sirupsen/logrus"
log
"github.com/sirupsen/logrus"
"github.com/topicai/candy"
"github.com/PaddlePaddle/Paddle/go/master"
"github.com/PaddlePaddle/Paddle/go/master"
"github.com/PaddlePaddle/Paddle/go/utils/networkhelper"
"github.com/PaddlePaddle/Paddle/go/utils/networkhelper"
...
@@ -20,11 +21,18 @@ func main() {
...
@@ -20,11 +21,18 @@ func main() {
port
:=
flag
.
Int
(
"port"
,
8080
,
"port of the master server."
)
port
:=
flag
.
Int
(
"port"
,
8080
,
"port of the master server."
)
ttlSec
:=
flag
.
Int
(
"ttl"
,
60
,
"etcd lease TTL in seconds."
)
ttlSec
:=
flag
.
Int
(
"ttl"
,
60
,
"etcd lease TTL in seconds."
)
endpoints
:=
flag
.
String
(
"endpoints"
,
"http://127.0.0.1:2379"
,
"comma separated etcd endpoints. If empty, fault tolerance will not be enabled."
)
endpoints
:=
flag
.
String
(
"endpoints"
,
"http://127.0.0.1:2379"
,
"comma separated etcd endpoints. If empty, fault tolerance will not be enabled."
)
taskTimeoutDur
:=
flag
.
Duration
(
"task_timout_dur"
,
20
*
time
.
Minute
,
"task timout duration."
)
taskTimeoutDur
:=
flag
.
Duration
(
"task-timout-dur"
,
20
*
time
.
Minute
,
"task timout duration."
)
taskTimeoutMax
:=
flag
.
Int
(
"task_timeout_max"
,
3
,
"max timtout count for each task before it being declared failed task."
)
taskTimeoutMax
:=
flag
.
Int
(
"task-timeout-max"
,
3
,
"max timtout count for each task before it being declared failed task."
)
chunkPerTask
:=
flag
.
Int
(
"chunk_per_task"
,
10
,
"chunk per task."
)
chunkPerTask
:=
flag
.
Int
(
"chunk-per-task"
,
10
,
"chunk per task."
)
logLevel
:=
flag
.
String
(
"log-level"
,
"info"
,
"log level, possible values: debug, info, warning, error, fatal, panic"
)
flag
.
Parse
()
flag
.
Parse
()
level
,
e
:=
log
.
ParseLevel
(
*
logLevel
)
candy
.
Must
(
e
)
log
.
SetLevel
(
level
)
if
*
endpoints
==
""
{
if
*
endpoints
==
""
{
log
.
Warningln
(
"-endpoints not set, fault tolerance not be enabled."
)
log
.
Warningln
(
"-endpoints not set, fault tolerance not be enabled."
)
}
}
...
...
python/paddle/v2/dataset/common.py
浏览文件 @
83f263e6
...
@@ -201,8 +201,10 @@ def convert(output_path,
...
@@ -201,8 +201,10 @@ def convert(output_path,
def
write_data
(
w
,
lines
):
def
write_data
(
w
,
lines
):
random
.
shuffle
(
lines
)
random
.
shuffle
(
lines
)
for
i
,
d
in
enumerate
(
lines
):
for
i
,
d
in
enumerate
(
lines
):
d
=
cPickle
.
dumps
(
d
)
# FIXME(Yancey1989):
w
[
i
%
num_shards
].
write
(
d
)
# dumps with protocol: pickle.HIGHEST_PROTOCOL
o
=
pickle
.
dumps
(
d
)
w
[
i
%
num_shards
].
write
(
o
)
w
=
open_writers
()
w
=
open_writers
()
lines
=
[]
lines
=
[]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录