#1 Mon 14 February 2022 18:35
- Roukens
- Participant occasionnel
- Date d'inscription: 14 Feb 2022
- Messages: 15
QGIS: Code erreur Python SCP
Bonjour,
J'essaye de faire une classification non-supervisée vie le Plugin "Semi-Automatic classification Plugin", mais je reçois fréquemment un message d'erreur (voir ci-dessous) lorsque je fais lance le traitement sur l'entièreté du set de bandes sur lequel je travail (R, G, B + PIR). J'utilise le paramétrage tel que proposé dans le manuel d'utilisateur du SCP, et j'ai déjà réussi à finaliser le traitement (10 itérations donc) sur certaines portions de l'image.
Quelqu'un aurait-il une piste sur la nature du problème/les solutions à apporter pour le résoudre?
Merci d'avance, Bonne journée, Pierre
Une erreur est survenue lors de l'éxécution du code Python:
AttributeError: 'NoneType' object has no attribute 'SetGeoTransform'
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "C:PROGRA~1QGIS32~1.3appsPython39libmultiprocessingpool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "C:Users/pierr/AppData/Roaming/QGIS/QGIS3profilesdefault/python/pluginsSemiAutomaticClassificationPlugincoreutils.py", line 4920, in processRasterDev
cfg.utls.createRasterFromReferenceMultiprocess(raster, 1, outputReferenceRasterList, nodataValue, 'GTiff', cfg.rasterDataType, compress, compressFormat, geotransform = geotransform, xSize = bSX, ySize = bSY)
File "C:Users/pierr/AppData/Roaming/QGIS/QGIS3profilesdefault/python/pluginsSemiAutomaticClassificationPlugincoreutils.py", line 3209, in createRasterFromReferenceMultiprocess
oR.SetGeoTransform(rGT)
AttributeError: 'NoneType' object has no attribute 'SetGeoTransform'
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:Users/pierr/AppData/Roaming/QGIS/QGIS3profilesdefault/python/pluginsSemiAutomaticClassificationPluginmaininterfaceclusteringTab.py", line 120, in calculateClusteringAction
self.calculateClustering()
File "C:Users/pierr/AppData/Roaming/QGIS/QGIS3profilesdefault/python/pluginsSemiAutomaticClassificationPluginmaininterfaceclusteringTab.py", line 202, in calculateClustering
self.isodataCalculation(tPMD, bL, clssOut, k_or_sigs, iterations, thresh, minSize, maxStandardDeviation, NoDataValue, batch, bandSetNumber)
File "C:Users/pierr/AppData/Roaming/QGIS/QGIS3profilesdefault/python/pluginsSemiAutomaticClassificationPluginmaininterfaceclusteringTab.py", line 233, in isodataCalculation
r, sigs, sL = self.isodataIteration(rD, bL, iteration, k_or_sigs, classNumber, iterations, thresh, minSize, maxStandardDeviation, NoDataValue, batch, bandSetNumber)
File "C:Users/pierr/AppData/Roaming/QGIS/QGIS3profilesdefault/python/pluginsSemiAutomaticClassificationPluginmaininterfaceclusteringTab.py", line 501, in isodataIteration
o = cfg.utls.multiProcessRaster(rasterPath = rD, signatureList = signatureListMP, functionBand = 'Yes', functionRaster = cfg.utls.classificationMultiprocess, algorithmName = algorithmName, outputNoDataValue = -999, macroclassCheck = 'No',classificationOptions = classificationOptions, functionBandArgument = cfg.multiAddFactorsVar, functionVariable = cfg.bandSetsList[bandSetNumber][6], progressMessage = cfg.QtWidgetsSCP.QApplication.translate('semiautomaticclassificationplugin', 'Classification iteration ') + str(iteration + 1).replace('-1', '*').replace('0', '*'), virtualRaster = 'Yes', compress = 'No')
File "C:Users/pierr/AppData/Roaming/QGIS/QGIS3profilesdefault/python/pluginsSemiAutomaticClassificationPlugincoreutils.py", line 5387, in multiProcessRaster
res = r[0].get()
File "C:PROGRA~1QGIS32~1.3appsPython39libmultiprocessingpool.py", line 771, in get
raise self._value
AttributeError: 'NoneType' object has no attribute 'SetGeoTransform'
Version de Python : 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
Version de QGIS : 3.22.3-Białowieża Białowieża, 1628765ec7
Chemin Python :
• C:/PROGRA~1/QGIS32~1.3/apps/qgis/./python
• C:/Users/pierr/AppData/Roaming/QGIS/QGIS3profilesdefault/python
• C:/Users/pierr/AppData/Roaming/QGIS/QGIS3profilesdefault/python/plugins
• C:/PROGRA~1/QGIS32~1.3/apps/qgis/./python/plugins
• C:Program FilesQGIS 3.22.3binpython39.zip
• C:PROGRA~1QGIS32~1.3appsPython39DLLs
• C:PROGRA~1QGIS32~1.3appsPython39lib
• C:Program FilesQGIS 3.22.3bin
• C:PROGRA~1QGIS32~1.3appsPython39
• C:PROGRA~1QGIS32~1.3appsPython39libsite-packages
• C:PROGRA~1QGIS32~1.3appsPython39libsite-packagesGDAL-3.4.1-py3.9-win-amd64.egg
• C:PROGRA~1QGIS32~1.3appsPython39libsite-packageswin32
• C:PROGRA~1QGIS32~1.3appsPython39libsite-packageswin32lib
• C:PROGRA~1QGIS32~1.3appsPython39libsite-packagesPythonwin
• C:/Users/pierr/AppData/Roaming/QGIS/QGIS3profilesdefault/python
Hors ligne