Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
731006f1
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
1 年多 前同步成功
通知
116
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
731006f1
编写于
4月 23, 2023
作者:
K
kangguangli
提交者:
cuicheng01
4月 25, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set seed by configs
上级
ee36c40d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
13 addition
and
2 deletion
+13
-2
ppcls/static/train.py
ppcls/static/train.py
+12
-1
test_tipc/static/ResNet50/benchmark_common/run_benchmark.sh
test_tipc/static/ResNet50/benchmark_common/run_benchmark.sh
+1
-1
未找到文件。
ppcls/static/train.py
浏览文件 @
731006f1
...
...
@@ -23,6 +23,9 @@ __dir__ = os.path.dirname(os.path.abspath(__file__))
sys
.
path
.
append
(
__dir__
)
sys
.
path
.
append
(
os
.
path
.
abspath
(
os
.
path
.
join
(
__dir__
,
'../../'
)))
import
numpy
as
np
import
random
import
paddle
from
paddle.distributed
import
fleet
from
visualdl
import
LogWriter
...
...
@@ -65,6 +68,15 @@ def main(args):
all the config of training paradigm should be in config["Global"]
"""
config
=
get_config
(
args
.
config
,
overrides
=
args
.
override
,
show
=
False
)
# set seed
seed
=
config
[
"Global"
].
get
(
"seed"
,
False
)
if
seed
or
seed
==
0
:
assert
isinstance
(
seed
,
int
),
"The 'seed' must be a integer!"
paddle
.
seed
(
seed
)
np
.
random
.
seed
(
seed
)
random
.
seed
(
seed
)
global_config
=
config
[
"Global"
]
mode
=
"train"
...
...
@@ -207,6 +219,5 @@ def main(args):
if
__name__
==
'__main__'
:
paddle
.
enable_static
()
paddle
.
seed
(
0
)
args
=
parse_args
()
main
(
args
)
test_tipc/static/ResNet50/benchmark_common/run_benchmark.sh
浏览文件 @
731006f1
...
...
@@ -47,7 +47,7 @@ function _train(){
log_file
=
${
profiling_log_file
}
fi
train_cmd
=
"
${
config_file
}
-o DataLoader.Train.sampler.batch_size=
${
base_batch_size
}
-o Global.epochs=
${
max_epochs
}
-o DataLoader.Train.loader.num_workers=
${
num_workers
}
${
profiling_config
}
-o Global.eval_during_train=False -o fuse_elewise_add_act_ops=True -o enable_addto=True"
train_cmd
=
"
${
config_file
}
-o DataLoader.Train.sampler.batch_size=
${
base_batch_size
}
-o Global.
seed=1234 -o Global.
epochs=
${
max_epochs
}
-o DataLoader.Train.loader.num_workers=
${
num_workers
}
${
profiling_config
}
-o Global.eval_during_train=False -o fuse_elewise_add_act_ops=True -o enable_addto=True"
# 以下为通用执行命令,无特殊可不用修改
case
${
run_mode
}
in
DP
)
if
[[
${
device_num
}
=
"N1C1"
]]
;
then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录