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 in generate_xml #43

Open
Crazy-Mage opened this issue Oct 21, 2019 · 0 comments
Open

error in generate_xml #43

Crazy-Mage opened this issue Oct 21, 2019 · 0 comments

Comments

@Crazy-Mage
Copy link

Crazy-Mage commented Oct 21, 2019

code
xml_str = ET.tostring(annotation)
print(xml_str)
root = etree.fromstring(xml_str)
xml_str=etree.tostring(root, pretty_print=True)
save_path = os.path.join(savedir, img.name.replace('jpg','xml'))
with open(save_path,'wb') as temp_xml:
temp_xml.write(xml_str)
Error
Traceback (most recent call last):
File "C:\Users\subha\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\cbook_init_.py", line 216, in process
func(*args, **kwargs)
File "make_annotation.py", line 31, in onkeypress
write_xml(image_folder, img, object_list, tl_list, br_list, savedir)
File "C:\VIT\SET\CODE\darkflow-master\new_model_data\generate_annotation.py", line 36, in write_xml
root = etree.fromstring(xml_str)
File "src\lxml\etree.pyx", line 3234, in lxml.etree.fromstring
File "src\lxml\parser.pxi", line 1876, in lxml.etree._parseMemoryDocument
File "src\lxml\parser.pxi", line 1764, in lxml.etree._parseDoc
File "src\lxml\parser.pxi", line 1127, in lxml.etree._BaseParser._parseDoc
File "src\lxml\parser.pxi", line 601, in lxml.etree._ParserContext._handleParseResultDoc
File "src\lxml\parser.pxi", line 711, in lxml.etree._handleParseResult
File "src\lxml\parser.pxi", line 640, in lxml.etree._raiseParseError
File "", line 1
lxml.etree.XMLSyntaxError: StartTag: invalid element name, line 1, column 237
xml_str contains
b'imagesreal_00001.jpg06006003facesUnspecified0< difficult>0</ difficult>21598597'

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