Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleGAN
提交
bee41a8f
P
PaddleGAN
项目概览
PaddlePaddle
/
PaddleGAN
1 年多 前同步成功
通知
97
Star
7254
Fork
1210
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleGAN
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
bee41a8f
编写于
8月 23, 2022
作者:
B
Birdylx
提交者:
GitHub
8月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update tipc benchmark (#680)
上级
f3a03618
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
15 deletion
+12
-15
ppgan/models/msvsr_model.py
ppgan/models/msvsr_model.py
+1
-1
test_tipc/benchmark_train.sh
test_tipc/benchmark_train.sh
+3
-4
test_tipc/prepare.sh
test_tipc/prepare.sh
+3
-7
test_tipc/test_train_inference_python.sh
test_tipc/test_train_inference_python.sh
+5
-3
未找到文件。
ppgan/models/msvsr_model.py
浏览文件 @
bee41a8f
...
...
@@ -132,7 +132,7 @@ class MultiStageVSRModel(BaseSRModel):
self
.
loss
=
sum
(
_value
for
_key
,
_value
in
self
.
losses
.
items
()
if
'loss_pix'
in
_key
)
scaled_loss
=
scaler
.
scale
(
self
.
loss
)
self
.
losses
[
'loss'
]
=
s
caled_
loss
self
.
losses
[
'loss'
]
=
s
elf
.
loss
scaled_loss
.
backward
()
scaler
.
minimize
(
optims
[
'optim'
],
scaled_loss
)
...
...
test_tipc/benchmark_train.sh
浏览文件 @
bee41a8f
...
...
@@ -100,11 +100,10 @@ for _flag in ${flags_list[*]}; do
done
# set log_name
BENCHMARK_ROOT
=
./
# self-test only
repo_name
=
$(
get_repo_name
)
SAVE_LOG
=
${
BENCHMARK_LOG_DIR
:-
$(
pwd
)
}
# */benchmark_log
mkdir
-p
"
${
SAVE_LOG
}
/benchmark_log/
"
status_log
=
"
${
SAVE_LOG
}
/
benchmark_log/
results.log"
SAVE_LOG
=
"
${
BENCHMARK_LOG_DIR
:-
$(
pwd
)
}
/benchmark_log"
# */benchmark_log
mkdir
-p
"
${
SAVE_LOG
}
"
status_log
=
"
${
SAVE_LOG
}
/results.log"
# The number of lines in which train params can be replaced.
line_python
=
3
...
...
test_tipc/prepare.sh
浏览文件 @
bee41a8f
...
...
@@ -28,9 +28,11 @@ function func_parser_value(){
IFS
=
$'
\n
'
# The training params
model_name
=
$(
func_parser_value
"
${
lines
[1]
}
"
)
trainer_list
=
$(
func_parser_value
"
${
lines
[14]
}
"
)
if
[
${
MODE
}
=
"benchmark_train"
]
;
then
MODE
=
"lite_train_lite_infer"
fi
if
[
${
MODE
}
=
"lite_train_lite_infer"
]
;
then
...
...
@@ -165,12 +167,6 @@ elif [ ${MODE} = "whole_infer" ];then
mkdir
-p
./data/singan
mv
./data/SinGAN-official_images/Images/stone.png ./data/singan
fi
elif
[
${
MODE
}
=
"benchmark_train"
]
;
then
if
[
${
model_name
}
==
"msvsr"
]
;
then
rm
-rf
./data/reds
*
wget
-nc
-P
./data/ https://paddlegan.bj.bcebos.com/datasets/reds_lite.tar
--no-check-certificate
cd
./data/
&&
tar
xf reds_lite.tar
&&
cd
../
fi
elif
[
${
MODE
}
=
"cpp_infer"
]
;
then
if
[
${
model_name
}
==
"msvsr"
]
;
then
rm
-rf
./inference/msvsr
*
...
...
test_tipc/test_train_inference_python.sh
浏览文件 @
bee41a8f
...
...
@@ -210,8 +210,10 @@ else
for
autocast
in
${
autocast_list
[*]
}
;
do
if
[
${
autocast
}
=
"fp16"
]
;
then
set_amp_config
=
"--amp"
set_amp_level
=
"--amp_level=O2"
else
set_amp_config
=
" "
set_amp_level
=
" "
fi
for
trainer
in
${
trainer_list
[*]
}
;
do
flag_quant
=
False
...
...
@@ -239,11 +241,11 @@ else
fi
set_save_model
=
$(
func_set_params
"
${
save_model_key
}
"
"
${
save_log
}
"
)
if
[
${#
gpu
}
-le
2
]
;
then
# train with cpu or single gpu
cmd
=
"
${
python
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_train_params1
}
${
set_epoch
}
${
set_pretrain
}
${
set_batchsize
}
${
set_amp_config
}
"
cmd
=
"
${
python
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_train_params1
}
${
set_epoch
}
${
set_pretrain
}
${
set_batchsize
}
${
set_amp_config
}
${
set_amp_level
}
"
elif
[
${#
ips
}
-le
26
]
;
then
# train with multi-gpu
cmd
=
"
${
python
}
-m paddle.distributed.launch --gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_train_params1
}
${
set_epoch
}
${
set_pretrain
}
${
set_batchsize
}
${
set_amp_config
}
"
cmd
=
"
${
python
}
-m paddle.distributed.launch --gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_train_params1
}
${
set_epoch
}
${
set_pretrain
}
${
set_batchsize
}
${
set_amp_config
}
${
set_amp_level
}
"
else
# train with multi-machine
cmd
=
"
${
python
}
-m paddle.distributed.launch --ips=
${
ips
}
--gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_train_params1
}
${
set_pretrain
}
${
set_epoch
}
${
set_batchsize
}
${
set_amp_config
}
"
cmd
=
"
${
python
}
-m paddle.distributed.launch --ips=
${
ips
}
--gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_train_params1
}
${
set_pretrain
}
${
set_epoch
}
${
set_batchsize
}
${
set_amp_config
}
${
set_amp_level
}
"
fi
# run train
eval
"unset CUDA_VISIBLE_DEVICES"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录