Closed JasonLiu-TJU closed 5 years ago
I also encountered the same problem
me too on debian stretch :(
Thanks for reporting. I will check this
Sorry for the inconvenience. Fixed already https://github.com/tzutalin/labelImg/commit/2df7b6e402d1b4dd4a6481afaf0ad7961609c8f1
I am trying to save the annotation files into xml file. But each time the following error code occurs:
Traceback (most recent call last): File "labelImg.py", line 1291, in saveFile self._saveFile(savedPath) File "labelImg.py", line 1320, in _saveFile if annotationFilePath and self.saveLabels(annotationFilePath): File "labelImg.py", line 802, in saveLabels self.lineColor.getRgb(), self.fillColor.getRgb()) File "/home/lj/workspace/Tools/labelImg/libs/labelFile.py", line 56, in savePascalVocFormat writer.save(targetFile=filename) File "/home/lj/workspace/Tools/labelImg/libs/pascal_voc_io.py", line 121, in save prettifyResult = self.prettify(root) File "/home/lj/workspace/Tools/labelImg/libs/pascal_voc_io.py", line 28, in prettify rough_string = ElementTree.tostring(elem, 'utf8') File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1126, in tostring ElementTree(element).write(file, encoding, method=method) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 820, in write serialize(write, self._root, encoding, qnames, namespaces) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 939, in _serialize_xml _serialize_xml(write, e, encoding, qnames, None) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 939, in _serialize_xml _serialize_xml(write, e, encoding, qnames, None) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 937, in _serialize_xml write(_escape_cdata(text, encoding)) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1075, in _escape_cdata _raise_serialization_error(text) File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1052, in _raise_serialization_error "cannot serialize %r (type %s)" % (text, type(text).__name__) TypeError: cannot serialize PyQt4.QtCore.QString(u'Hardshell crabs') (type QString)
Thanks and best regars