Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1 #7

Open
mansi-aggarwal-2504 opened this issue May 6, 2021 · 0 comments

Comments

@mansi-aggarwal-2504
Copy link

On line 157, in create_pascal_tf_record.py (from extra folder), when I run xml_str = fid.read(), the resultant xml_str is empty. And hence, when I run xml = etree.fromstring(xml_str), it's throwing the following error:

    xml = etree.fromstring(xml_str)
  File "src/lxml/etree.pyx", line 3237, in lxml.etree.fromstring
  File "src/lxml/parser.pxi", line 1896, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1777, in lxml.etree._parseDoc
  File "src/lxml/parser.pxi", line 1082, in lxml.etree._BaseParser._parseUnicodeDoc
  File "src/lxml/parser.pxi", line 615, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 725, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 654, in lxml.etree._raiseParseError
  File "<string>", line 1
lxml.etree.XMLSyntaxError: Document is empty, line 1, column 1

I am using the VOC 2012 data and I check the first image and its xml in labelimg and it's not empty.
So why am I getting this error?

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

No branches or pull requests

1 participant