Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes with argument 1 has unexpected type 'float' #3

Open
simbamangu opened this issue Mar 13, 2024 · 1 comment
Open

Crashes with argument 1 has unexpected type 'float' #3

simbamangu opened this issue Mar 13, 2024 · 1 comment

Comments

@simbamangu
Copy link

simbamangu commented Mar 13, 2024

Have tried this with MacOS Sonoma 14.4, both Python 3.10 and 3.11 with same error.

Steps:

mv ~/.labelmerc ~/.labelmerc_bkp # remove old labelme config
mkvirtualenv smarterlabelme -p 3.10 # create an environment
pip install --upgrade pip
pip install PyYAML # not indicated as requirement in readme
pip install PyQt5
python3 -m pip install --upgrade "git+https://github.com/robot-perception-group/smarter-labelme@master"

Error:

Traceback (most recent call last):
  File "/Users/.../.virtualenvs/smartlabelme/lib/python3.10/site-packages/labelme/widgets/canvas.py", line 632, in paintEvent
    p.translate(self.offsetToCenter())
  File "/Users/.../.virtualenvs/smartlabelme/lib/python3.10/site-packages/labelme/widgets/canvas.py", line 691, in offsetToCenter
    return QtCore.QPoint(x, y)
TypeError: arguments did not match any overloaded call:
  QPoint(): too many arguments
  QPoint(xpos: int, ypos: int): argument 1 has unexpected type 'float'
  QPoint(a0: QPoint): argument 1 has unexpected type 'float'
[1]    54615 abort      smarter_labelme
@jorgegalinmor
Copy link

I've had the same error, apparently its due to a mismatch with the Qt version, I solved it locally casting the types inputed to QPoint, like so: "QPoint(int(x), int(y))", but I think it should be solvable also changing Qpoint with QpointF. You might need to do this in several other locations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants