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
49382181
Unverified
Commit
49382181
authored
Aug 19, 2021
by
Double_V
Committed by
GitHub
Aug 19, 2021
Browse files
Merge pull request #3717 from littletomatodonkey/dyg/fix_cls_type
fix cls type
parents
ab16f2e4
66c3294c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
ppocr/losses/cls_loss.py
ppocr/losses/cls_loss.py
+1
-1
No files found.
ppocr/losses/cls_loss.py
View file @
49382181
...
@@ -25,6 +25,6 @@ class ClsLoss(nn.Layer):
...
@@ -25,6 +25,6 @@ class ClsLoss(nn.Layer):
self
.
loss_func
=
nn
.
CrossEntropyLoss
(
reduction
=
'mean'
)
self
.
loss_func
=
nn
.
CrossEntropyLoss
(
reduction
=
'mean'
)
def
forward
(
self
,
predicts
,
batch
):
def
forward
(
self
,
predicts
,
batch
):
label
=
batch
[
1
]
label
=
batch
[
1
]
.
astype
(
"int64"
)
loss
=
self
.
loss_func
(
input
=
predicts
,
label
=
label
)
loss
=
self
.
loss_func
(
input
=
predicts
,
label
=
label
)
return
{
'loss'
:
loss
}
return
{
'loss'
:
loss
}
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