semiautomaticgit/SemiAutomaticClassificationPlugin

Classification Run stopped with error

Closed this issue · 1 comments

Hello, I am looking for some assistance with this issue below. Thanks in advance for any insights. The log is attached to this message. This occurred while performing classification on a raster Landsat8 and temporal ROI with 7 Macro classes and 1 subclass for each MC. I am running QGIS desktop 3.33.10 on a PC - 64bit. I debugged the SCP and all connections checked OK.

An error has occurred while executing Python code:

AttributeError: 'QSortFilterProxyModel' object has no attribute 'refreshLayerLegend'
Traceback (most recent call last):
File "C:\Users/ezsen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin_v6-master\dock\scpdock.py", line 525, in runClassificationAction
self.runClassification()
File "C:\Users/ezsen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin_v6-master\dock\scpdock.py", line 603, in runClassification
self.applyClassSymbology(c, cfg.macroclassCheck, cfg.qmlFl, sL)
File "C:\Users/ezsen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin_v6-master\dock\scpdock.py", line 719, in applyClassSymbology
cfg.utls.rasterSymbol(classificationRaster, signatureList, macroclassCheck)
File "C:\Users/ezsen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin_v6-master\core\utils.py", line 645, in rasterSymbol
cfg.utls.refreshLayerSymbology(classLayer)
File "C:\Users/ezsen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\SemiAutomaticClassificationPlugin_v6-master\core\utils.py", line 5492, in refreshLayerSymbology
model.refreshLayerLegend(g)
AttributeError: 'QSortFilterProxyModel' object has no attribute 'refreshLayerLegend'

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS version: 3.22.10-Bia?owie?a Bia?owie?a, 6a63fd37

Python Path:
C:/PROGRA1/QGIS321.10/apps/qgis-ltr/./python
C:/Users/ezsen/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/ezsen/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA1/QGIS321.10/apps/qgis-ltr/./python/plugins
C:\Program Files\Python37
C:\Program Files\Python37\DLLs
C:\Program Files\Python37\Lib
C:\Program Files\Python37\Scripts
C:\Program Files\QGIS 3.22.10\bin\python39.zip
C:\PROGRA1\QGIS321.10\apps\Python39\DLLs
C:\PROGRA1\QGIS321.10\apps\Python39\lib
C:\Program Files\QGIS 3.22.10\bin
C:\PROGRA1\QGIS321.10\apps\Python39
C:\PROGRA1\QGIS321.10\apps\Python39\lib\site-packages
SCP_Error.txt

C:\PROGRA1\QGIS321.10\apps\Python39\lib\site-packages\win32
C:\PROGRA1\QGIS321.10\apps\Python39\lib\site-packages\win32\lib
C:\PROGRA1\QGIS321.10\apps\Python39\lib\site-packages\Pythonwin
C:/Users/ezsen/AppData/Roaming/QGIS/QGIS3\profiles\default/python

Hello @ezsener ,
you are using an outdated version of SCP.
The error is related QSortFilterProxyModel that changed in QGIS APIs.
I suggest to update to SCP 7.
If you intend to use SCP 6 you should install a previous version of QGIS also in order to avoid APIs issues.