From 5e160a5e96c7f8f1e764f94902e58591ffc1560f Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Wed, 30 Jun 2021 12:13:14 +0800 Subject: [PATCH] add detail error to dataset --- ppocr/data/simple_dataset.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ppocr/data/simple_dataset.py b/ppocr/data/simple_dataset.py index 0906167f..5379ad1d 100644 --- a/ppocr/data/simple_dataset.py +++ b/ppocr/data/simple_dataset.py @@ -14,6 +14,7 @@ import numpy as np import os import random +import traceback from paddle.io import Dataset from .imaug import transform, create_operators @@ -117,9 +118,10 @@ class SimpleDataSet(Dataset): data['ext_data'] = self.get_ext_data() outs = transform(data, self.ops) except Exception as e: + error_meg = traceback.format_exc() self.logger.error( "When parsing line {}, error happened with msg: {}".format( - data_line, e)) + data_line, error_meg)) outs = None if outs is None: # during evaluation, we should fix the idx to get same results for many times of evaluation. -- GitLab