Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleGAN
提交
9cbcf94a
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看板
未验证
提交
9cbcf94a
编写于
8月 10, 2021
作者:
L
LielinJiang
提交者:
GitHub
8月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix basicvsr bug on windows platform (#389)
上级
5996700b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
8 deletion
+13
-8
ppgan/models/basicvsr_model.py
ppgan/models/basicvsr_model.py
+13
-8
未找到文件。
ppgan/models/basicvsr_model.py
浏览文件 @
9cbcf94a
...
...
@@ -18,7 +18,7 @@ import paddle.nn as nn
from
.builder
import
MODELS
from
.sr_model
import
BaseSRModel
from
.generators.iconvsr
import
EDVRFeatureExtractor
from
.generators.basicvsr
import
ResidualBlockNoBN
,
PixelShufflePack
,
SPyNet
from
.generators.basicvsr
import
ResidualBlockNoBN
,
PixelShufflePack
,
SPyNet
from
..modules.init
import
reset_parameters
from
..utils.visual
import
tensor2img
...
...
@@ -74,10 +74,10 @@ class BasicVSRModel(BaseSRModel):
self
.
visual_items
[
'output'
]
=
self
.
output
[:,
0
,
:,
:,
:]
# pixel loss
loss_pixel
=
self
.
pixel_criterion
(
self
.
output
,
self
.
gt
)
loss_pixel
.
backward
()
optims
[
'optim'
].
step
()
self
.
losses
[
'loss_pixel'
]
=
loss_pixel
self
.
current_iter
+=
1
...
...
@@ -91,8 +91,11 @@ class BasicVSRModel(BaseSRModel):
out_img
=
[]
gt_img
=
[]
for
out_tensor
,
gt_tensor
in
zip
(
self
.
output
[
0
],
self
.
gt
[
0
]):
# print(out_tensor.shape, gt_tensor.shape)
_
,
t
,
_
,
_
,
_
=
self
.
gt
.
shape
for
i
in
range
(
t
):
out_tensor
=
self
.
output
[
0
,
i
]
gt_tensor
=
self
.
gt
[
0
,
i
]
out_img
.
append
(
tensor2img
(
out_tensor
,
(
0.
,
1.
)))
gt_img
.
append
(
tensor2img
(
gt_tensor
,
(
0.
,
1.
)))
...
...
@@ -103,10 +106,12 @@ class BasicVSRModel(BaseSRModel):
def
init_basicvsr_weight
(
net
):
for
m
in
net
.
children
():
if
hasattr
(
m
,
'weight'
)
and
not
isinstance
(
m
,
(
nn
.
BatchNorm
,
nn
.
BatchNorm2D
)):
if
hasattr
(
m
,
'weight'
)
and
not
isinstance
(
m
,
(
nn
.
BatchNorm
,
nn
.
BatchNorm2D
)):
reset_parameters
(
m
)
continue
if
(
not
isinstance
(
m
,
(
ResidualBlockNoBN
,
PixelShufflePack
,
SPyNet
,
EDVRFeatureExtractor
))):
if
(
not
isinstance
(
m
,
(
ResidualBlockNoBN
,
PixelShufflePack
,
SPyNet
,
EDVRFeatureExtractor
))):
init_basicvsr_weight
(
m
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录