Error extarctAsArray?

Issue #146 resolved
Thang Hanam created an issue

Can you give me a second to explain what kind of this error?

Thank you very much!

Processing algorithm
Algorithm 'Fit LinearSVC' starting
Input parameters:
{ 'classification' : '/tmp/processing_a5c7602ef78e4ca3b6b5d562bba72704/530cfccbaa1e4a38b4a34b174e3db28f/outClassification.bsq', 'code' : 'from sklearn.pipeline import make_pipeline\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.svm import LinearSVC\n\nsvc = LinearSVC()\nparam_grid = {\'C\': [0.001, 0.01, 0.1, 1, 10, 100, 1000]}\ntunedSVC = GridSearchCV(cv=3, estimator=svc, scoring=\'f1_macro\', param_grid=param_grid)\nestimator = make_pipeline(StandardScaler(), tunedSVC)\n', 'mask' : None, 'outEstimator' : '/tmp/processing_a5c7602ef78e4ca3b6b5d562bba72704/00aed78564804f9085c8d435a95b3cc1/outEstimator.pkl', 'raster' : '/home/metal/Desktop/enmap/tauclip.tif' }

Traceback (most recent call last):
File "/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxgeoalgorithms/provider.py", line 118, in processAlgorithm
result = self.processAlgorithm_()
File "//QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxgeoalgorithms/algorithms.py", line 264, in processAlgorithm_
estimator.fit(sample=self.sample())
File "//QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages/hubflow/core.py", line 2939, in _fit
features, labels = sample.extractAsArray()
File "//QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages/hubflow/core.py", line 2786, in extractAsArray
return MapCollection.extractAsArray(self, grid=grid, masks=masks, onTheFlyResampling=onTheFlyResampling, **kwargs)
File "/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages/hubflow/core.py", line 610, in extractAsArray
assert onTheFlyResampling is True
AssertionError

Traceback (most recent call last):
File "QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxgeoalgorithms/provider.py", line 118, in processAlgorithm
result = self.processAlgorithm_()
File "//QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxgeoalgorithms/algorithms.py", line 264, in processAlgorithm_
estimator.fit(sample=self.sample())
File "//QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages/hubflow/core.py", line 2939, in _fit
features, labels = sample.extractAsArray()
File "/QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages/hubflow/core.py", line 2786, in extractAsArray
return MapCollection.extractAsArray(self, grid=grid, masks=masks, onTheFlyResampling=onTheFlyResampling, **kwargs)
File "//QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/site-packages/hubflow/core.py", line 610, in extractAsArray
assert onTheFlyResampling is True
AssertionError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "//QGIS/QGIS3/profiles/default/python/plugins/enmapboxplugin/enmapboxgeoalgorithms/provider.py", line 132, in processAlgorithm
raise Exception('unexpected error')
Exception: unexpected error

Execution failed after 0.12 seconds

Loading resulting layers
Algorithm 'Fit LinearSVC' finished

Test on Lubuntu 18.04.

The whole dataset give no error but take so much time to fit the model.

When I resize the image, it throws this message.

Comments (6)

  1. Andreas Janz

    The pixel grid (i.e. extent and resolution) of Raster and Classification inputs in the Fit algorithm must exactly match.

  2. Thang Hanam reporter

    I got it. Will remeber this error for the next image processing.

    Thank you very much!

    Bets reagrds,

  3. Log in to comment