问题描述*:标注工具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。文章来源:https://www.toymoban.com/news/detail-588859.html
我们可以新建python低版本环境,在里面在安装。参考以下链接。
Anaconda里装labelimg使用Anaconda Prompt详细步骤文章来源地址https://www.toymoban.com/news/detail-588859.html
到了这里,关于标注工具Labelimg,正常运行显示,但是对图片点击Create RectBox画矩形框开始闪退的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!