Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleGAN
提交
93d8fca1
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看板
提交
93d8fca1
编写于
9月 16, 2020
作者:
L
LielinJiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rm unused code
上级
99d09216
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
69 deletion
+0
-69
ppgan/datasets/builder.py
ppgan/datasets/builder.py
+0
-4
ppgan/models/sr_model.py
ppgan/models/sr_model.py
+0
-65
未找到文件。
ppgan/datasets/builder.py
浏览文件 @
93d8fca1
...
...
@@ -111,8 +111,4 @@ def build_dataloader(cfg, is_train=True):
dataloader
=
DictDataLoader
(
dataset
,
batch_size
,
is_train
,
num_workers
)
# for i, item in enumerate(dataloader):
# print(i, item.keys())
# # break
# print('dataset build success!')
return
dataloader
ppgan/models/sr_model.py
浏览文件 @
93d8fca1
...
...
@@ -28,16 +28,7 @@ class SRModel(BaseModel):
self
.
visual_names
=
[
'lq'
,
'output'
,
'gt'
]
self
.
loss_names
=
[
'l_total'
]
# define network
# self.net_g = networks.define_net_g(deepcopy(opt['network_g']))
# self.net_g = self.model_to_device(self.net_g)
# self.print_network(self.net_g)
# load pretrained models
# load_path = self.opt['path'].get('pretrain_model_g', None)
# if load_path is not None:
# self.load_network(self.net_g, load_path,
# self.opt['path']['strict_load'])
self
.
optimizers
=
[]
if
self
.
isTrain
:
self
.
criterionL1
=
paddle
.
nn
.
L1Loss
()
...
...
@@ -48,68 +39,12 @@ class SRModel(BaseModel):
self
.
lr_scheduler
,
parameter_list
=
self
.
netG
.
parameters
())
self
.
optimizers
.
append
(
self
.
optimizer_G
)
# self.optimizer_D = build_optimizer(
# opt.optimizer,
# self.lr_scheduler,
# parameter_list=self.netD.parameters())
# self.init_training_settings()
# def init_training_settings(self):
# self.net_g.train()
# train_opt = self.opt['train']
# # define losses
# if train_opt.get('pixel_opt'):
# pixel_type = train_opt['pixel_opt'].pop('type')
# cri_pix_cls = getattr(loss_module, pixel_type)
# self.cri_pix = cri_pix_cls(**train_opt['pixel_opt']).to(
# self.device)
# else:
# self.cri_pix = None
# if train_opt.get('perceptual_opt'):
# percep_type = train_opt['perceptual_opt'].pop('type')
# cri_perceptual_cls = getattr(loss_module, percep_type)
# self.cri_perceptual = cri_perceptual_cls(
# **train_opt['perceptual_opt']).to(self.device)
# else:
# self.cri_perceptual = None
# if self.cri_pix is None and self.cri_perceptual is None:
# raise ValueError('Both pixel and perceptual losses are None.')
# # set up optimizers and schedulers
# self.setup_optimizers()
# self.setup_schedulers()
# def setup_optimizers(self):
# train_opt = self.opt['train']
# optim_params = []
# for k, v in self.net_g.named_parameters():
# if v.requires_grad:
# optim_params.append(v)
# else:
# logger = get_root_logger()
# logger.warning(f'Params {k} will not be optimized.')
# optim_type = train_opt['optim_g'].pop('type')
# if optim_type == 'Adam':
# self.optimizer_g = torch.optim.Adam(optim_params,
# **train_opt['optim_g'])
# else:
# raise NotImplementedError(
# f'optimizer {optim_type} is not supperted yet.')
# self.optimizers.append(self.optimizer_g)
def
set_input
(
self
,
input
):
self
.
lq
=
paddle
.
to_tensor
(
input
[
'lq'
])
if
'gt'
in
input
:
self
.
gt
=
paddle
.
to_tensor
(
input
[
'gt'
])
self
.
image_paths
=
input
[
'lq_path'
]
# self.lq = data['lq'].to(self.device)
# if 'gt' in data:
# self.gt = data['gt'].to(self.device)
def
forward
(
self
):
pass
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录