Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleHub
提交
f1d4dc6d
P
PaddleHub
项目概览
PaddlePaddle
/
PaddleHub
大约 1 年 前同步成功
通知
282
Star
12117
Fork
2091
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
200
列表
看板
标记
里程碑
合并请求
4
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleHub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
200
Issue
200
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f1d4dc6d
编写于
9月 27, 2020
作者:
H
haoyuying
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
revise style transfer second time
上级
991f2a7e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
6 deletion
+4
-6
hub_module/modules/image/style_transfer/msgnet/module.py
hub_module/modules/image/style_transfer/msgnet/module.py
+4
-6
未找到文件。
hub_module/modules/image/style_transfer/msgnet/module.py
浏览文件 @
f1d4dc6d
...
@@ -187,8 +187,7 @@ class Inspiration(nn.Layer):
...
@@ -187,8 +187,7 @@ class Inspiration(nn.Layer):
return
x
return
x
def
__repr__
(
self
):
def
__repr__
(
self
):
return
self
.
__class__
.
__name__
+
'('
\
return
self
.
__class__
.
__name__
+
'('
+
'N x '
+
str
(
self
.
C
)
+
')'
+
'N x '
+
str
(
self
.
C
)
+
')'
class
Vgg16
(
nn
.
Layer
):
class
Vgg16
(
nn
.
Layer
):
...
@@ -282,6 +281,7 @@ class MSGNet(nn.Layer):
...
@@ -282,6 +281,7 @@ class MSGNet(nn.Layer):
block
=
Bottleneck
block
=
Bottleneck
upblock
=
UpBottleneck
upblock
=
UpBottleneck
expansion
=
4
expansion
=
4
model
=
[]
model1
=
[
model1
=
[
ConvLayer
(
input_nc
,
64
,
kernel_size
=
7
,
stride
=
1
),
ConvLayer
(
input_nc
,
64
,
kernel_size
=
7
,
stride
=
1
),
...
@@ -290,14 +290,12 @@ class MSGNet(nn.Layer):
...
@@ -290,14 +290,12 @@ class MSGNet(nn.Layer):
block
(
64
,
32
,
2
,
1
,
norm_layer
),
block
(
64
,
32
,
2
,
1
,
norm_layer
),
block
(
32
*
expansion
,
ngf
,
2
,
1
,
norm_layer
)
block
(
32
*
expansion
,
ngf
,
2
,
1
,
norm_layer
)
]
]
self
.
model1
=
nn
.
Sequential
(
*
tuple
(
model1
))
self
.
model1
=
nn
.
Sequential
(
*
tuple
(
model1
))
model
=
[]
model
+=
model1
model
+=
model1
self
.
ins
=
Inspiration
(
ngf
*
expansion
)
self
.
ins
=
Inspiration
(
ngf
*
expansion
)
model
.
append
(
self
.
ins
)
model
.
append
(
self
.
ins
)
for
i
in
range
(
n_blocks
):
for
i
in
range
(
n_blocks
):
model
+=
[
block
(
ngf
*
expansion
,
ngf
,
1
,
None
,
norm_layer
)]
model
+=
[
block
(
ngf
*
expansion
,
ngf
,
1
,
None
,
norm_layer
)]
...
@@ -308,6 +306,7 @@ class MSGNet(nn.Layer):
...
@@ -308,6 +306,7 @@ class MSGNet(nn.Layer):
nn
.
ReLU
(),
nn
.
ReLU
(),
ConvLayer
(
16
*
expansion
,
output_nc
,
kernel_size
=
7
,
stride
=
1
)
ConvLayer
(
16
*
expansion
,
output_nc
,
kernel_size
=
7
,
stride
=
1
)
]
]
model
=
tuple
(
model
)
model
=
tuple
(
model
)
self
.
model
=
nn
.
Sequential
(
*
model
)
self
.
model
=
nn
.
Sequential
(
*
model
)
...
@@ -330,7 +329,6 @@ class MSGNet(nn.Layer):
...
@@ -330,7 +329,6 @@ class MSGNet(nn.Layer):
model_dict
[
key
]
=
paddle
.
ones
(
shape
=
model_dict
[
key
].
shape
,
dtype
=
'float32'
)
model_dict
[
key
]
=
paddle
.
ones
(
shape
=
model_dict
[
key
].
shape
,
dtype
=
'float32'
)
self
.
set_dict
(
model_dict
)
self
.
set_dict
(
model_dict
)
print
(
"load pretrained checkpoint success"
)
print
(
"load pretrained checkpoint success"
)
self
.
_vgg
=
None
self
.
_vgg
=
None
def
transform
(
self
,
path
:
str
):
def
transform
(
self
,
path
:
str
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录