未验证 提交 4619f414 编写于 作者: G Guanghua Yu 提交者: GitHub

fix export model with solov2_enhance (#3590)

上级 5fc41a27
...@@ -252,7 +252,7 @@ class SOLOv2Head(nn.Layer): ...@@ -252,7 +252,7 @@ class SOLOv2Head(nn.Layer):
bias_attr=ParamAttr(initializer=Constant( bias_attr=ParamAttr(initializer=Constant(
value=float(-np.log((1 - 0.01) / 0.01)))))) value=float(-np.log((1 - 0.01) / 0.01))))))
if self.drop_block: if self.drop_block and self.training:
self.drop_block_fun = DropBlock( self.drop_block_fun = DropBlock(
block_size=3, keep_prob=0.9, name='solo_cate.dropblock') block_size=3, keep_prob=0.9, name='solo_cate.dropblock')
...@@ -324,13 +324,13 @@ class SOLOv2Head(nn.Layer): ...@@ -324,13 +324,13 @@ class SOLOv2Head(nn.Layer):
for kernel_layer in self.kernel_pred_convs: for kernel_layer in self.kernel_pred_convs:
kernel_feat = F.relu(kernel_layer(kernel_feat)) kernel_feat = F.relu(kernel_layer(kernel_feat))
if self.drop_block: if self.drop_block and self.training:
kernel_feat = self.drop_block_fun(kernel_feat) kernel_feat = self.drop_block_fun(kernel_feat)
kernel_pred = self.solo_kernel(kernel_feat) kernel_pred = self.solo_kernel(kernel_feat)
# cate branch # cate branch
for cate_layer in self.cate_pred_convs: for cate_layer in self.cate_pred_convs:
cate_feat = F.relu(cate_layer(cate_feat)) cate_feat = F.relu(cate_layer(cate_feat))
if self.drop_block: if self.drop_block and self.training:
cate_feat = self.drop_block_fun(cate_feat) cate_feat = self.drop_block_fun(cate_feat)
cate_pred = self.solo_cate(cate_feat) cate_pred = self.solo_cate(cate_feat)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册