Crashes due to unexpected type 'float'
See original GitHub issueAttempting to zoom via mouse wheel or to draw a bounding box results in an immediate crash. Here’s the output when I try to draw a bounding box:
Traceback (most recent call last):
File "/home/stan/.conda/envs/pytorch_cuda3090/lib/python3.10/site-packages/labelImg/labelImg.py", line 1014, in zoom_request
self.add_zoom(scale * units)
File "/home/stan/.conda/envs/pytorch_cuda3090/lib/python3.10/site-packages/labelImg/labelImg.py", line 974, in add_zoom
self.set_zoom(self.zoom_widget.value() + increment)
File "/home/stan/.conda/envs/pytorch_cuda3090/lib/python3.10/site-packages/labelImg/labelImg.py", line 971, in set_zoom
self.zoom_widget.setValue(value)
TypeError: setValue(self, int): argument 1 has unexpected type 'float'
zsh: IOT instruction (core dumped) labelImg
#841 sounds like the same issue.
$ uname -rvsmio
# Linux 5.19.5-arch1-1 #1 SMP PREEMPT_DYNAMIC Mon, 29 Aug 2022 15:51:05 +0000 x86_64 unknown GNU/Linux
$ conda list | grep -E '(qt)|(labelimg)'
# labelimg 1.8.6 py310hff52083_1 conda-forge
# pyqt 5.15.7 py310h29803b5_0 conda-forge
# pyqt5-sip 12.11.0 py310hd8f1fbe_0 conda-forge
# qt-main 5.15.4 ha5833f6_2 conda-forge
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Float to int conversion in Qt and Python 3.10 on Fedora 35 beta.
The "unexpected type 'int'" or "'float'" is related, but "argument of type 'NoneType' is not iterable" is a different issue. The " ...
Read more >2015428 – hp-toolbox crashes due Python3.10 changes
Description of problem: hp-toolbox crashes when trying to do certain things. ... Preset): argument 3 has unexpected type 'float' fillRect(self, QRect, ...
Read more >ReText (python application) broken by recent python upgrades
Issue is as follows: pressing the preview button crashes the application ... int): argument 1 has unexpected type 'float' Process Process-1: ...
Read more >SOLVED frescobaldi suddenly not opening - Arch Linux Forums
however, frescobaldi starts up but crashes. ... FontSize, int): argument 2 has unexpected type 'float' zsh: abort (core dumped) frescobaldi.
Read more >package management - downgrade spyder - Ask Ubuntu
... transformMode: Qt.TransformationMode = Qt.FastTransformation): argument 1 has unexpected type 'float' scaled(self, QSize, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Solution. Error in Qt5. float to int conversion Changed: x:\xxxxx\python-310\Lib\site-packages\libs\canvas.py 526 line: default: p.drawRect(left_top.x(), left_top.y(), rect_width), int(rect_height) new: p.drawRect(int(left_top.x()), int(left_top.y()), int(rect_width), int(rect_height)) 530 line: default: p.drawLine( self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height()) new: p.drawLine( int(self.prev_point.x()), 0, int(self.prev_point.x()), int(self.pixmap.height())) 531 line: default: p.drawLine( 0, self.prev_point.y(), self.pixmap.width(), self.prev_point.y()) new: p.drawLine( 0, int(self.prev_point.y()), int(self.pixmap.width()), int(self.prev_point.y())) Changed: x:\xxxxx\python-310\Lib\site-packages\labelImg\labelImg.py 965 line: default: bar.setValue(bar.value() + bar.singleStep() * units) new: bar.setValue(int(bar.value() + bar.singleStep() * units))
I think someone needs to release a new version of labelimg with current code. Version 1.8.6 does not contain the fixed code.