You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def forward(self, predicts, batch):
loss_dict = {}
for idx, model_name in enumerate(self.model_name_list):
out = predicts[model_name]
if self.key is not None:
out = out[self.key]
**loss = super().forward(out, batch)**
if isinstance(loss, dict):
for key in loss.keys():
if key == "loss":
continue
name = "{}_{}_{}".format(self.name, model_name, key)
loss_dict[name] = loss[key]
else:
loss_dict["{}_{}".format(self.name, model_name)] = loss
loss_dict = _sum_loss(loss_dict)
return loss_dict
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, thanks for your great works.
I did OCR detection training with 'ch_PP-OCRv4_det_cml.yml' on my custom dataset.
And I just found there is a something wrong with 'DistillationDilaDBLoss'
It inherits 'DBLoss' and it should send some parameters but in the definition in DistillationDilaDBLoss.init, it does not.
Any reason for this ?
Thank you.
class DBLoss(nn.Layer):
"""
Differentiable Binarization (DB) Loss Function
args:
param (dict): the super paramter for DB Loss
"""
class DistillationDBLoss(DBLoss):
def init(
self,
model_name_list=[],
balance_loss=True,
main_loss_type="DiceLoss",
alpha=5,
beta=10,
ohem_ratio=3,
eps=1e-6,
name="db",
**kwargs,
):
super().init()
self.model_name_list = model_name_list
self.name = name
self.key = None
Beta Was this translation helpful? Give feedback.
All reactions