Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
122c82e9
Commit
122c82e9
authored
Oct 23, 2020
by
WenmuZhou
Browse files
测试模式时将输出softmax后返回
parent
6241b8f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
ppocr/modeling/heads/rec_ctc_head.py
ppocr/modeling/heads/rec_ctc_head.py
+3
-0
No files found.
ppocr/modeling/heads/rec_ctc_head.py
View file @
122c82e9
...
@@ -20,6 +20,7 @@ import math
...
@@ -20,6 +20,7 @@ import math
import
paddle
import
paddle
from
paddle
import
ParamAttr
,
nn
from
paddle
import
ParamAttr
,
nn
from
paddle.nn
import
functional
as
F
def
get_para_bias_attr
(
l2_decay
,
k
,
name
):
def
get_para_bias_attr
(
l2_decay
,
k
,
name
):
...
@@ -48,4 +49,6 @@ class CTC(nn.Layer):
...
@@ -48,4 +49,6 @@ class CTC(nn.Layer):
def
forward
(
self
,
x
,
labels
=
None
):
def
forward
(
self
,
x
,
labels
=
None
):
predicts
=
self
.
fc
(
x
)
predicts
=
self
.
fc
(
x
)
if
not
self
.
training
:
predicts
=
F
.
softmax
(
predicts
,
axis
=
2
)
return
predicts
return
predicts
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment