- changed title to Error message "TypeError: type of argument "value" must be one of (int, str); got float instead"
- edited description
Error message "TypeError: type of argument "value" must be one of (int, str); got float instead"
Issue #644
resolved
EnMAP Box Version 3.7.20210318T105835.feature_overhaul_processing
Python command:
>>>processing.run('enmapbox:RasterizeVectorClassification', dict(vector=QgsVectorLayer(r'C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxtestdata/landcover_berlin_polygon.shp'), grid=QgsRasterLayer(r'C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxtestdata/hires_berlin.bsq'), creationProfile=3, outraster='C:/Users/Henrike Dierkes/AppData/Local/Temp/processing_nTpBZe/eb2fd22e15ae47f89509b4ad387f6459\\_temp_outClassifier.pkl\\classification.tif'))
Error message:
Derive class ids from renderer categories
Rasterite vector classification
Calculate pixel coverage
Mask pixel with low coverage
Execution completed in 48.67 seconds
Results:
{'outraster': 'C:/Users/Henrike Dierkes/AppData/Local/Temp/processing_nTpBZe/eb2fd22e15ae47f89509b4ad387f6459\\_temp_outClassifier.pkl\\classification.tif'}
Results: {'outraster': 'C:/Users/Henrike Dierkes/AppData/Local/Temp/processing_nTpBZe/eb2fd22e15ae47f89509b4ad387f6459\\_temp_outClassifier.pkl\\classification.tif'}
Traceback (most recent call last):
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\algorithm\fitclassifieralgorithmbase.py", line 187, in processAlgorithm
X, y, categories = self.sampleAny(
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\algorithm\fitclassifieralgorithmbase.py", line 296, in sampleAny
X, y, categories = cls.samplePixels(raster, classification, maximumMemoryUsage, feedback)
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\algorithm\fitclassifieralgorithmbase.py", line 330, in samplePixels
categories = Utils.categoriesFromPalettedRasterRenderer(renderer)
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
retval = func(*args, **kwargs)
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\utils.py", line 200, in categoriesFromPalettedRasterRenderer
categories = [Category(c.value, c.label, c.color.name()) for c in renderer.classes()]
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\utils.py", line 200, in <listcomp>
categories = [Category(c.value, c.label, c.color.name()) for c in renderer.classes()]
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 902, in wrapper
check_argument_types(memo)
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 748, in check_argument_types
raise exc from None
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 746, in check_argument_types
check_type(description, value, expected_type, memo)
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 641, in check_type
checker_func(argname, value, expected_type, memo)
File "C:/Users/Henrike Dierkes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 448, in check_union
raise TypeError('type of {} must be one of ({}); got {} instead'.
TypeError: type of argument "value" must be one of (int, str); got float instead
Execution failed after 48.77 seconds
Loading resulting layers
Algorithm 'Fit RandomForestClassifier' finished
Getting the same error message for different algorithms, e.g. “fit random forest classifier” and “random points in raster”
Comments (4)
-
reporter -
Thank’s Henrike, this problem was introduced by QGIS 3.18. I fixed it already.
-
- changed status to resolved
-
fixes
#644(loads <repo/site-packages with site)Signed-off-by: Benjamin Jakimow benjamin.jakimow@geo.hu-berlin.de benjamin.jakimow@geo.hu-berlin.de
→ <<cset 1879f231483b>>
- Log in to comment