labelimg闪退问题解决 | 报错argument 1 has unexpected type ‘float’

文章讲述了在高版本Python3.11环境中遇到`drawLine`函数TypeError的问题,解决方案是创建一个Python3.9环境并重新安装labelimg,提供了解决过程和YOLOV5目标检测中labelimg的使用教程链接。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Traceback (most recent call last):
  File "E:\intersim\miniconda\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'

解决方法:

我的base环境里面使用的是python 3.11,版本过高。创建一个版本较低的python环境。

(base) pip uninstall labelimg

conda create -n labelimg python==3.9

conda activate labelimg

pip install labelimg -i https://pypi.tuna.tsinghua.edu.cn/simple

labelimg的使用教程:

YOLOV5目标检测---labelimg图片标注工具(1)_yolo标注软件-优快云博客

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值