【解决labelimg标注图片闪退问题】drawLine(self, l: QLineF): argument 1 has unexpected type ‘float‘ 您所在的位置:网站首页 rediscommandtimeout闪退 【解决labelimg标注图片闪退问题】drawLine(self, l: QLineF): argument 1 has unexpected type ‘float‘

【解决labelimg标注图片闪退问题】drawLine(self, l: QLineF): argument 1 has unexpected type ‘float‘

#【解决labelimg标注图片闪退问题】drawLine(self, l: QLineF): argument 1 has unexpected type ‘float‘| 来源: 网络整理| 查看: 265

在labelimg进行图片标注时,出现闪退报错如下:drawLine(self, l: QLineF): argument 1 has unexpected type ‘float’

报错信息如下 TypeError: arguments did not match any overloaded call: drawLine(self, QLineF): argument 1 has unexpected type 'float' drawLine(self, QLine): argument 1 has unexpected type 'float' drawLine(self, int, int, int, int): argument 1 has unexpected type 'float' drawLine(self, QPoint, QPoint): argument 1 has unexpected type 'float' drawLine(self, Union[QPointF, QPoint], Union[QPointF, QPoint]): argument 1 has unexpected type 'float' 尝试方法1

尝试了修改文件代码这个方法,但是依旧闪退 将canvas.py文件 526、530、531行的float改为int。(找不到文件的话,直接搜索就行) 参考:https://blog.csdn.net/red_flag1921/article/details/130487444?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522170576410916800225547096%2522%252C%2522scm%2522%253A%252220140713.130102334…%2522%257D&request_id=170576410916800225547096&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduend~default-1-130487444-null-null.142v99pc_search_result_base8&utm_term=drawLine%28self%2C%20l%3A%20QLineF%29%3A%20argument%201%20has%20unexpected%20type%20float&spm=1018.2226.3001.4187 如图所示分别为修改前后:修改前修改后

可能原因

python版本过高,我的base环境里面使用的是python 3.11

尝试方法2(可解决)

使用以下代码,创建一个版本较低的python环境

conda create -n labelimg python =3.9 conda创建labelimg的环境,指定python版本为3.9 插入链接与图片

要标注的图片位置 在箭头所示的地方输入命令“CALL conda.bat activate”,然后切换base环境到低版本的python环境中,再使用命令“labelimg 05 classes.txt”。我的classes.txt文件就在img_data文件夹下。“05”是我要标记的照片文件夹名称,可以根据自己的需要进行修改。 请添加图片描述 按以上的方法,就可以进行正常标注了。

另外,labelimg的使用教程可参考:https://blog.csdn.net/J_oshua/article/details/130017483



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有