问题描述*:标注工具Labelimg,正常运行显示,但是对图片点击Create RectBox画矩形框开始闪退,闪退出现以下代码
File “C:\ProgramData\anaconda3\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’
而且点击Create RectBox点没有线出来,过几秒闪退
(base) PS C:\Users\Administrator> labelimg
Traceback (most recent call last):
File "C:\ProgramData\anaconda3\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'
解决问题:
因为可能你安装的Anaconda里python版本过高,比如装的Anaconda是python3.11版本,重把python版本改低一点,那就重新装一个,用anaconda prompt。
我们可以新建python低版本环境,在里面在安装。参考以下链接。
Anaconda里装labelimg使用Anaconda Prompt详细步骤