报错:
Traceback (most recent call last):
File "C:\Users\86186\AppData\Local\Programs\Python\Python310\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'
解决方法:
1、将python版本退回3.9
Win 10 环境:Pycharm、anaconda、python3.10
注:anaconda下载及配置环境变量参考:
(6条消息) Anaconda超详细安装教程(Windows环境下)_windows安装conda_菜鸟1号!!的博客-CSDN博客
1)、打开cmd
2)、执行下列命令
conda install python==3.9
3)、查看python版本,是否降版本成功
python --version 或 python -V
参考链接:(6条消息) [Win 10]Python降版本方法、Python3.9降至3.7_Bouble Q的博客-CSDN博客
2、将canvas.py文件 526、530、531行的float改为int。(找不到文件的话,直接搜索就行)
改前:
改后:
参考链接:
Unable to draw annotations on Windows · Issue #811 · heartexlabs/labelImg · GitHub文章来源:https://www.toymoban.com/news/detail-474844.html
我改完以后即可正常框选,不过不一定适用你们的情况~~~文章来源地址https://www.toymoban.com/news/detail-474844.html
到了这里,关于labelimg点击框选图片就闪退报错的解决办法(不一定具有普适性)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!