unexpected type 'float'
- OS: Windows 10
- Python Version: 3.11.4
- PyQt version:5.15.9
Install labelImg through pip. When the folder is opened and labeled with data, it will flash back with an error as follows:
TraceBack:
C:\Users\Chanpoe>labelImg
Traceback (most recent call last):
File "C:\Users\Chanpoe\AppData\Local\Programs\Python\Python311\Lib\site-packages\libs\canvas.py", line 530, in paintEvent
p.drawLine(self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height())
TypeError: arguments did not match any overloaded call:
drawLine(self, l: QLineF): argument 1 has unexpected type 'float'
drawLine(self, line: QLine): argument 1 has unexpected type 'float'
drawLine(self, x1: int, y1: int, x2: int, y2: int): argument 1 has unexpected type 'float'
drawLine(self, p1: QPoint, p2: QPoint): argument 1 has unexpected type 'float'
drawLine(self, p1: Union[QPointF, QPoint], p2: Union[QPointF, QPoint]): argument 1 has unexpected type 'float'
I have the same problem
Try a lower version of Python, like Python 3.7.2
If you want to keep using your Python version, navigate to the C:\Users\Chanpoe\AppData\Local\Programs\Python\Python311\Lib\site-packages\libs\canvas.py
line 530 wrap the self.prev_point.x() with int()
I can successfully run and label the data by using this packaged exe file: https://github.com/tzutalin/labelImg/files/2638199/windows_v1.8.1.zip