labelme
labelme copied to clipboard
Unable to run,lots of TypeError
First off, I performed the following commands when installing (Windows 10, using Anaconda):
conda create --name=labelme python=3
conda activate labelme
pip install labelme
When i try to run labelme, I got the following error:
`Traceback (most recent call last): File "E:\ProgramData\Anaconda3\envs\Image-style-transfer-gp\lib\site-packages\labelme\widgets\canvas.py", line 618, in paintEvent p.translate(self.offsetToCenter()) File "E:\ProgramData\Anaconda3\envs\Image-style-transfer-gp\lib\site-packages\labelme\widgets\canvas.py", line 659, in offsetToCenter return QtCore.QPoint(x, y) TypeError: arguments did not match any overloaded call: QPoint(): too many arguments QPoint(int, int): argument 1 has unexpected type 'float' QPoint(QPoint): argument 1 has unexpected type 'float'
I don't know what caused the problem, maybe a version update of Qt?
Hello, I've run into a similar problem. I tried opening the apc2016_obj3.jpg image for the tutorial and it throws a QtCore error, more specifically:
Traceback (most recent call last): File "C:.conda\envs\labelme\lib\site-packages\labelme\app.py", line 1537, in loadFile self.loadLabels(self.labelFile.shapes) File "C:.conda\envs\labelme\lib\site-packages\labelme\app.py", line 1226, in loadLabels self.loadShapes(s) File "C:.conda\envs\labelme\lib\site-packages\labelme\app.py", line 1187, in loadShapes self.addLabel(shape) File "C:.conda\envs\labelme\lib\site-packages\labelme\app.py", line 1137, in addLabel self.labelList.addItem(label_list_item) File "C:.conda\envs\labelme\lib\site-packages\labelme\widgets\label_list_widget.py", line 167, in addItem item.setSizeHint(self.itemDelegate().sizeHint(None, None)) File "C:.conda\envs\labelme\lib\site-packages\labelme\widgets\label_list_widget.py", line 64, in sizeHint return QtCore.QSize( TypeError: arguments did not match any overloaded call: QSize(): too many arguments QSize(int, int): argument 1 has unexpected type 'float' QSize(QSize): argument 1 has unexpected type 'float'
I am running labelme on Windows 10 with Anaconda.
I followed the advice by parksangback in this post https://github.com/wkentaro/labelme/issues/1006#issuecomment-1086885920 and it runs smoothly.
Apparently the QtCore
API has changed in Python 3.10 and now some types are not allowed in different parts of the code. I can make a PR to add all of the int conversions and add support for Python 3.10