From 80561b154e1c32dc8d80dd3f28be5dcd6b462639 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Tue, 6 Jul 2021 07:55:05 +0000 Subject: [PATCH] x as dict --- ppocr/modeling/architectures/base_model.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ppocr/modeling/architectures/base_model.py b/ppocr/modeling/architectures/base_model.py index 03fbcee8..ff3da01a 100644 --- a/ppocr/modeling/architectures/base_model.py +++ b/ppocr/modeling/architectures/base_model.py @@ -79,7 +79,10 @@ class BaseModel(nn.Layer): x = self.neck(x) y["neck_out"] = x x = self.head(x, targets=data) - y["head_out"] = x + if type(x) is dict: + y.update(x) + else: + y["head_out"] = x if self.return_all_feats: return y else: -- GitLab