diff --git a/ppocr/losses/distillation_loss.py b/ppocr/losses/distillation_loss.py index 5812544e91d8357c161e4faa4d0e36ce4dbd9374..97a33733008fdac7b08febb9808ec85bc415e7bd 100644 --- a/ppocr/losses/distillation_loss.py +++ b/ppocr/losses/distillation_loss.py @@ -745,6 +745,8 @@ class DistillationDilaDBLoss(DBLoss): # dilation to teacher prediction dilation_w = np.array([[1, 1], [1, 1]]) th_shrink_maps = tch_preds[:, 0, :, :] + if hasattr(paddle.Tensor, "contiguous"): + th_shrink_maps = th_shrink_maps.contiguous() th_shrink_maps = th_shrink_maps.numpy() > 0.3 # thresh = 0.3 dilate_maps = np.zeros_like(th_shrink_maps).astype(np.float32) for i in range(th_shrink_maps.shape[0]):