Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
49065aff
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
49065aff
编写于
12月 22, 2017
作者:
L
Luo Tao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unused usage_stat script
上级
fc5c432a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
1 addition
and
181 deletion
+1
-181
paddle/scripts/CMakeLists.txt
paddle/scripts/CMakeLists.txt
+0
-8
paddle/scripts/submit_local.sh.in
paddle/scripts/submit_local.sh.in
+0
-3
paddle/scripts/tools/usage_stat/usage.sh
paddle/scripts/tools/usage_stat/usage.sh
+0
-168
python/setup.py.in
python/setup.py.in
+1
-2
未找到文件。
paddle/scripts/CMakeLists.txt
浏览文件 @
49065aff
...
...
@@ -5,11 +5,3 @@ configure_file(submit_local.sh.in
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/paddle DESTINATION bin
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
)
configure_file
(
tools/usage_stat/usage.sh
paddle_usage
@ONLY
)
install
(
FILES
${
CMAKE_CURRENT_BINARY_DIR
}
/paddle_usage DESTINATION opt/paddle/bin
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
)
paddle/scripts/submit_local.sh.in
浏览文件 @
49065aff
...
...
@@ -165,9 +165,6 @@ case "$1" in
"make_diagram"
)
python
-m
paddle.utils.make_model_diagram
${
@
:2
}
;;
"usage"
)
$PADDLE_BIN_PATH
/paddle_usage
${
@
:2
}
;;
"version"
)
version
;;
...
...
paddle/scripts/tools/usage_stat/usage.sh
已删除
100755 → 0
浏览文件 @
fc5c432a
#!/bin/bash
ARGPARSE
=
`
getopt
-o
u:vin:l:e:
--long
git-user:,help,dry-run,task-name:,log-file:,exit-code:
--
"
$@
"
`
KEEP_ANONYMOUS
=
"A_USER_DOES_NOT_TELL_US"
# paddle config home dir, same as paddle
PADDLE_CONF_HOME
=
"
$HOME
/.config/paddle"
# api url, mirror url(s) will be append later
PD_URLS
=
"http://api.paddlepaddle.org/version"
usage
()
{
echo
"Usage:
`
basename
$0
`
[options]"
echo
"Options:"
echo
" -e, --exit-code=EXIT_CODE The train/predict process's exit code"
echo
" -l, --log-file=LOG_FILE_PATH Read which log file to get the duration of process"
echo
" -n, --task-name=TASK_NAME The name of demo or example"
echo
" -u, --git-user=GITHUB_USER provide contact info, like username or email"
echo
" -v, -i Verbose output and interact with user when necessary"
echo
" --help display this help message"
}
eval set
--
"
${
ARGPARSE
}
"
while
true
;
do
case
"
$1
"
in
-l
|
--log-file
)
log_file
=
$2
shift
2
;;
-e
|
--exit-code
)
exit_code
=
$2
shift
2
;;
-u
|
--git-user
)
github_user
=
$2
shift
2
;;
-n
|
--task-name
)
task
=
$2
shift
2
;;
-v
|
-i
)
v
=
1
shift
;;
--dry-run
)
dry_run
=
1
shift
;;
--
)
shift
break
;;
--help
)
usage
exit
0
;;
*
)
echo
"Invalid option
$1
"
usage
exit
1
;;
esac
done
# parse the log_file to get the time costs
if
[
-s
"
${
log_file
}
"
]
;
then
duration
=
`
awk
'BEGIN{day=0;last_sec=0;min_sec=0;max_sec=0;}
{if(index($2,":")==3){
t=substr($2,1,8);
sec=day*86400+substr(t,1,2)*3600+substr(t,4,2)*60+substr(t,7,2);
if(sec<last_sec-600){day+=1;sec+=86400;}
last_sec=sec;
if(min_sec==0 || min_sec>sec){min_sec=sec;}
if(max_sec==0 || max_sec<sec){max_sec=sec;}
}}
END{print max_sec-min_sec}'
${
log_file
}
`
else
duration
=
-1
fi
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"duration:
${
duration
}
"
;
fi
# try find the user/email if not given
if
[
-z
"
${
github_user
}
"
]
;
then
# search for cached username
if
[
-s
"
${
PADDLE_CONF_HOME
}
/github_user"
]
;
then
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"read github_user from cache..."
;
fi
github_user
=
`
cat
${
PADDLE_CONF_HOME
}
/github_user
`
else
# search the github-user from git config
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"read github_user from git..."
;
fi
git_username
=
`
git config
--get
user.name 2>/dev/null
`
git_url
=
`
git config
--get
remote.origin.url 2>/dev/null
`
if
[
"
`
echo
${
git_url
}
|
cut
-b
1-19
`
"
=
"https://github.com/"
]
;
then
# under a git url, like https://github.com/user_xxx/proj_yyy.git
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
" from github url..."
;
fi
github_user
=
`
echo
${
git_url
}
|
cut
-d
"/"
-f
4
`
if
[
"
${
github_user
}
"
=
"PaddlePaddle"
]
;
then
github_user
=
fi
fi
if
[
-n
"
${
git_username
}
"
-a
-z
"
${
github_user
}
"
]
;
then
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
" from global git username..."
;
fi
github_user
=
${
git_username
}
fi
fi
fi
# allow user to set the user name, if it's not found
if
[
-z
"
${
github_user
}
"
-a
"
${
v
}
"
=
"1"
]
;
then
read
-p
"Please input your github username or email, or just return to keep this feedback anonymous:"
github_user
=
${
REPLY
}
if
[
-z
"
${
github_user
}
"
]
;
then
# empty input, consider as one anonymous user
github_user
=
"
${
KEEP_ANONYMOUS
}
"
fi
fi
if
[
-n
"
${
github_user
}
"
-a
-z
"
${
dry_run
}
"
]
;
then
# valid user and not in dry-run mode, then save to cache
mkdir
-p
${
PADDLE_CONF_HOME
}
echo
"
${
github_user
}
"
>
${
PADDLE_CONF_HOME
}
/github_user
fi
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"username:
${
github_user
}
"
;
fi
if
[
"
${
github_user
}
"
=
"
${
KEEP_ANONYMOUS
}
"
]
;
then
# anonymous user should keep the var empty.
github_user
=
fi
# read local paddle version
paddle_version
=
`
paddle version |
grep
PaddlePaddle |
head
-n1
|
cut
-d
" "
-f
2 |
cut
-d
","
-f
1
`
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"version:
${
paddle_version
}
"
;
fi
# read local system time
system_time
=
`
date
"+%Y%m%d%H%M%S"
`
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"system time:
${
system_time
}
"
;
fi
# make empty job_name as default value.
if
[
-z
"
${
task
}
"
]
;
then
task
=
"(unknown_task)"
fi
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"task:
${
task
}
"
;
fi
# concat the curl command
params
=
"content={
\"
data_type
\"
:
\"
usage
\"
,
\
\"
system_time
\"
:
${
system_time
}
,
\"
paddle_version
\"
:
\"
${
paddle_version
}
\"
,
\
\"
github_user
\"
:
\"
${
github_user
}
\"
,
\"
job_name
\"
:
\"
${
task
}
\"
,
\
\"
duration
\"
:
${
duration
}
,
\"
exit_code
\"
:
\"
${
exit_code
}
\"\
}&type=1"
curl_cmd_prefix
=
"curl -m 5 -X POST -d
${
params
}
\
-b
${
PADDLE_CONF_HOME
}
/paddle.cookie -c
${
PADDLE_CONF_HOME
}
/paddle.cookie "
if
[
"
${
dry_run
}
"
=
"1"
]
;
then
first_url
=
`
echo
${
PD_URLS
}
|
cut
-d
" "
-f
1
`
echo
"(dry-run mode)curl command:
${
curl_cmd_prefix
}
${
first_url
}
"
exit
0
else
for
u
in
${
PD_URLS
}
;
do
curl_cmd
=
"
${
curl_cmd_prefix
}
${
u
}
"
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"run:
${
curl_cmd
}
"
;
fi
${
curl_cmd
}
>
/dev/null 2>&1
if
[
$?
-eq
0
]
;
then
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"upload OK!"
;
fi
exit
0
else
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"upload failed...try next"
;
fi
fi
done
if
[
"
${
v
}
"
=
"1"
]
;
then
echo
"all urls tried but all failed...exit"
;
fi
exit
1
fi
python/setup.py.in
浏览文件 @
49065aff
...
...
@@ -79,8 +79,7 @@ if '${CMAKE_SYSTEM_PROCESSOR}' not in ['arm', 'armv7-a', 'aarch64']:
# the prefix is sys.prefix which should always be usr
paddle_bin_dir = 'opt/paddle/bin'
paddle_bins = ['${PADDLE_BINARY_DIR}/paddle/scripts/paddle_usage',
'${PADDLE_BINARY_DIR}/paddle/trainer/paddle_trainer',
paddle_bins = ['${PADDLE_BINARY_DIR}/paddle/trainer/paddle_trainer',
'${PADDLE_BINARY_DIR}/paddle/trainer/paddle_merge_model',
'${PADDLE_BINARY_DIR}/paddle/pserver/paddle_pserver_main',
'${PADDLE_BINARY_DIR}/paddle/scripts/paddle']
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录