Skip to content

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

Open
@mansi-aggarwal-2504

Description

@mansi-aggarwal-2504

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions