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

OverflowError: cannot convert float infinity to integer when running segmentator on "visible part" #143

Open
adrianloy opened this issue Feb 13, 2024 · 6 comments

Comments

@adrianloy
Copy link

First of all, thanks a lot for this plugin, it is very useful for us.

With the latest version, it seems to me that running a segmentation model on "visible part" is bugged, here is the stacktrace I am getting:

An error has occurred while executing Python code: 

OverflowError: cannot convert float infinity to integer 
Traceback (most recent call last):
  File "/home/adrianloy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/deepness/deepness.py", line 267, in _run_model_inference
    self._map_processor = map_processor_class(
  File "/home/adrianloy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/deepness/processing/map_processor/map_processor_segmentation.py", line 29, in __init__
    super().__init__(
  File "/home/adrianloy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/deepness/processing/map_processor/map_processor_with_model.py", line 19, in __init__
    super().__init__(
  File "/home/adrianloy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/deepness/processing/map_processor/map_processor.py", line 78, in __init__
    self.extended_extent = extent_utils.calculate_extended_processing_extent(
  File "/home/adrianloy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/deepness/processing/extent_utils.py", line 80, in calculate_extended_processing_extent
    current_x_pixels = round(tmp_extent.width() / rlayer_units_per_pixel)
OverflowError: cannot convert float infinity to integer


Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] 
QGIS version: 3.34.3-Prizren Prizren, exported 

Python Path:
/usr/share/qgis/python
/home/adrianloy/.local/share/QGIS/QGIS3/profiles/default/python
/home/adrianloy/.local/share/QGIS/QGIS3/profiles/default/python/plugins
/usr/share/qgis/python/plugins
/usr/share/qgis/python
/usr/share/qgis/python/plugins
/usr/lib/python3/dist-packages/qgis
/usr/share/qgis/python/qgis
/usr/lib/python310.zip
/usr/lib/python3.10
/usr/lib/python3.10/lib-dynload
/usr/local/lib/python3.10/dist-packages
/usr/lib/python3/dist-packages
/home/adrianloy/.local/share/QGIS/QGIS3/profiles/default/python
/home/adrianloy/.local/share/QGIS/QGIS3/profiles/default/python/plugins/deepness/python3.10

I can reproduce this both with our custom model as well as with the deeplabv3 "landcover" segmentor model . Running on the whole layer works.

@bartoszptak
Copy link
Contributor

Hi @adrianloy ,
thanks for reporting, we have to check it!

Could you provide the version of your operating system, python interpreter and QGIS?

@bartoszptak
Copy link
Contributor

Ooo, now I see.

Python is 3.10.12 and QGIS is 3.34.3, so please share the operating system's version with us.

@adrianloy
Copy link
Author

I am executing it within docker. My image is based on FROM qgis/qgis:release-3_34
That should run some ubuntu under the hood, I can check in a bit which exact version. Host machine is also Ubuntu based, but that should not matter I guess.

@bartoszptak
Copy link
Contributor

Hi,
I checked the pipeline using the container you provided, with the landcover example on Bing map loaded using QuickMapService and everything looks good. Maybe is there an issue with the compatibility of Deepness and your raster layer? Could you check the process on any layer from QuickMapService, e.g. Bing Aerial?

@adrianloy
Copy link
Author

Thanks for checking it so quickly. I will give it a try, any ideas what could be the issue? This worked in the past, I could also try to downgrade deepness again to verify that the latest release broke this on our dataset

@bartoszptak
Copy link
Contributor

Thanks. We are not able to check all OS/QGIS/Models/layers combinations. Therefore, we generally base on automatic python tests for Ubuntu 20/22 and two or three manual GUI tests. So, if you discover any specific problem, we will try to fix it ASAP!

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