Error at Predict Classification (RF)
Issue #636
resolved
I get this error when I try to predict a classification from an existing pkl model (RF):
QGIS version: 3.16.3-Hannover
QGIS code revision: 94ac9f21b8
Qt version: 5.11.2
GDAL version: 3.1.4
GEOS version: 3.8.1-CAPI-1.13.3
PROJ version: Rel. 6.3.2, May 1st, 2020
Processing algorithm…
Algorithm 'Predict Classification' starting…
Input parameters:
{ 'classifier' : 'D:\\Ignacio2019\\SanFinx\\SanFinx-Emma\\Classification\\EnMAP\\RFWithOptimization\\FX17_SFpanel_subsc_PC_RFCnbtopt_nbpredoptim.pkl', 'mask' : 'D:/Ignacio2019/SanFinx/SanFinx-Emma/Classification/Gisela_Panel/FX17_SFpanel_subsc_masks/FX17_SFpanel_subsc_maskyes.envi', 'outClassification' : 'D:/Ignacio2019/SanFinx/SanFinx-Emma/Classification/EnMAP/RFWithOptimization/FX17_SFpanel_subsc_PC_RFCnbt500_nbpredoptim_maskyes.bsq', 'raster' : 'D:/Ignacio2019/SanFinx/SanFinx-Emma/Classification/EnMAP/FX17_SFpanel_subsc_PC.envi' }
Traceback (most recent call last):
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxgeoalgorithms\provider.py", line 152, in processAlgorithm
result = self.processAlgorithm_()
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxgeoalgorithms\algorithms.py", line 397, in processAlgorithm_
estimator.predict(filename=filename, raster=raster, mask=mask, progressBar=self._progressBar)
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\hubflow\core.py", line 5255, in _predict
if raster.dataset().zsize() == self.sample().raster().dataset().zsize():
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\hubflow\core.py", line 812, in dataset
self._rasterDataset = openRasterDataset(self.filename(), eAccess=self._eAccess)
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\hubdc\core.py", line 2677, in openRasterDataset
raise errors.FileNotExistError(filename)
hubdc.hubdcerrors.FileNotExistError: E:/Ignacio2019/SanFinx/SanFinx-Emma/Classification/Gisela_Panel/FX17_SFpanel_subsc_PC.envi
Traceback (most recent call last):
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxgeoalgorithms\provider.py", line 152, in processAlgorithm
result = self.processAlgorithm_()
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxgeoalgorithms\algorithms.py", line 397, in processAlgorithm_
estimator.predict(filename=filename, raster=raster, mask=mask, progressBar=self._progressBar)
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\hubflow\core.py", line 5255, in _predict
if raster.dataset().zsize() == self.sample().raster().dataset().zsize():
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\hubflow\core.py", line 812, in dataset
self._rasterDataset = openRasterDataset(self.filename(), eAccess=self._eAccess)
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\hubdc\core.py", line 2677, in openRasterDataset
raise errors.FileNotExistError(filename)
hubdc.hubdcerrors.FileNotExistError: E:/Ignacio2019/SanFinx/SanFinx-Emma/Classification/Gisela_Panel/FX17_SFpanel_subsc_PC.envi
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/1/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxgeoalgorithms\provider.py", line 166, in processAlgorithm
raise Exception('unexpected error')
Exception: unexpected error
Execution failed after 1.18 seconds
Loading resulting layers
Algorithm 'Predict Classification' finished
Comments (5)
-
-
reporter What do you mean by “you removed that file afterwards”? I do have load it
-
At the time you trained the model, you used this file:
E:/Ignacio2019/SanFinx/SanFinx-Emma/Classification/Gisela_Panel/FX17_SFpanel_subsc_PC.envi
I guess, this file has been moved elsewhere, right?
-
reporter Even with the image loaded in EnMapBox?? This is really inconvenient, hope you can fix it very soon.
-
- changed status to resolved
Please check if this is now solved in the new classification algo.
- Log in to comment
I assume that
FX17_SFpanel_subsc_PC.envi
is the file used for training, and you removed that file afterwards. This is a known issue, and we will fix this in a future version. For now you have to keep the files used for training (which is not so nice).