Skip to content

[Bug] Fix bug in PPOCRLabel.py#166

Merged
GreatV merged 5 commits intoPFCCLab:mainfrom
Sam-gsj:bug1
Jun 11, 2025
Merged

[Bug] Fix bug in PPOCRLabel.py#166
GreatV merged 5 commits intoPFCCLab:mainfrom
Sam-gsj:bug1

Conversation

@Sam-gsj
Copy link
Collaborator

@Sam-gsj Sam-gsj commented Jun 11, 2025

When clicking on “Table Recognition,” if no table is detected, an empty table is created, but this triggers an error. The following is the error message:

Traceback (most recent call last):
File "/Users/guoshengjian/PPOCRLabel/PPOCRLabel.py", line 3153, in TableRecognition
tablepyxl.document_to_xl("", excel_path)
File "/Users/guoshengjian/PPOCRLabel/tablepyxl/tablepyxl.py", line 118, in document_to_xl
wb = document_to_workbook(doc, base_url=base_url)
File "/Users/guoshengjian/PPOCRLabel/tablepyxl/tablepyxl.py", line 104, in document_to_workbook
).transform()
File "/opt/miniconda3/envs/Label/lib/python3.10/site-packages/premailer/premailer.py", line 353, in transform
tree = etree.fromstring(stripped, parser).getroottree()
AttributeError: 'NoneType' object has no attribute 'getroottree'
zsh: abort python PPOCRLabel.py

The error occurs because the document_to_xl() function is being called with an empty string (""), which leads to a None value being processed by premailer, resulting in the AttributeError.

@Sam-gsj Sam-gsj changed the title fix bug in PPOCRLabel.py [Bug] Fix bug in PPOCRLabel.py Jun 11, 2025
@Sam-gsj
Copy link
Collaborator Author

Sam-gsj commented Jun 11, 2025

"enable_mkldnn":False 当用cpu运行时需要关闭此加速选项,后续官方会修复这个bug。

@GreatV
Copy link
Collaborator

GreatV commented Jun 11, 2025

please fix codestyle

Copy link
Collaborator

@GreatV GreatV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GreatV GreatV merged commit 9d5e48d into PFCCLab:main Jun 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants