Skip to content

Commit 42f390d

Browse files
authored
fix edvr (PaddlePaddle#446)
1 parent a95ce33 commit 42f390d

File tree

3 files changed

+13
-216
lines changed

3 files changed

+13
-216
lines changed

ppgan/models/generators/edvr.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import paddle
16-
1715
import numpy as np
1816

17+
import paddle
1918
import paddle.nn as nn
20-
from ...modules.init import kaiming_normal_, constant_, constant_init
19+
from paddle.vision.ops import DeformConv2D
2120

22-
from ...modules.dcn import DeformableConv_dygraph
23-
# from paddle.vision.ops import DeformConv2D #to be compiled
21+
from ...modules.init import kaiming_normal_, constant_, constant_init
2422

2523
from .builder import GENERATORS
2624

@@ -373,14 +371,13 @@ def __init__(self,
373371
self.total_channels = self.deformable_groups * 3 * self.kernel_size[
374372
0] * self.kernel_size[1]
375373
self.split_channels = self.total_channels // 3
376-
self.dcn = DeformableConv_dygraph(
377-
num_filters=self.num_filters,
378-
filter_size=self.kernel_size,
379-
dilation=dilation,
380-
stride=stride,
381-
padding=padding,
382-
deformable_groups=self.deformable_groups)
383-
# self.dcn = DeformConv2D(in_channels=self.num_filters,out_channels=self.num_filters,kernel_size=self.kernel_size,stride=stride,padding=padding,dilation=dilation,deformable_groups=self.deformable_groups,groups=1) # to be compiled
374+
self.dcn = DeformConv2D(in_channels=self.num_filters,
375+
out_channels=self.num_filters,
376+
kernel_size=self.kernel_size,
377+
stride=stride,
378+
padding=padding,
379+
dilation=dilation,
380+
deformable_groups=self.deformable_groups)
384381
self.sigmoid = nn.Sigmoid()
385382
# init conv offset
386383
constant_init(self.conv_offset_mask, 0., 0.)

ppgan/models/generators/mpr.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,16 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import paddle
16-
1715
import numpy as np
1816

17+
import paddle
1918
import paddle.nn as nn
20-
from ...modules.init import kaiming_normal_, constant_
19+
import paddle.nn.functional as F
2120

22-
from ...modules.dcn import DeformableConv_dygraph
23-
# from paddle.vision.ops import DeformConv2D #to be compiled
21+
from ...modules.init import kaiming_normal_, constant_
2422

2523
from .builder import GENERATORS
2624

27-
import paddle
28-
from paddle import nn
29-
import paddle.nn.functional as F
30-
3125

3226
##########################################################################
3327
def conv(in_channels, out_channels, kernel_size, bias_attr=False, stride=1):

ppgan/modules/dcn.py

Lines changed: 0 additions & 194 deletions
This file was deleted.

0 commit comments

Comments
 (0)