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
e9c3ff84
Commit
e9c3ff84
authored
Nov 22, 2021
by
tink2123
Browse files
fix attenton loss for ce
parent
f26846cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
2 deletions
+0
-2
ppocr/modeling/heads/rec_att_head.py
ppocr/modeling/heads/rec_att_head.py
+0
-2
No files found.
ppocr/modeling/heads/rec_att_head.py
View file @
e9c3ff84
...
...
@@ -45,7 +45,6 @@ class AttentionHead(nn.Layer):
output_hiddens
=
[]
if
targets
is
not
None
:
print
(
"target is not None"
)
for
i
in
range
(
num_steps
):
char_onehots
=
self
.
_char_to_onehot
(
targets
[:,
i
],
onehot_dim
=
self
.
num_classes
)
...
...
@@ -55,7 +54,6 @@ class AttentionHead(nn.Layer):
output
=
paddle
.
concat
(
output_hiddens
,
axis
=
1
)
probs
=
self
.
generator
(
output
)
else
:
print
(
"target is None"
)
targets
=
paddle
.
zeros
(
shape
=
[
batch_size
],
dtype
=
"int32"
)
probs
=
None
char_onehots
=
None
...
...
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