-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Describe the bug
The MLP (Multilayer Perceptron) process freezes at 90%. A possible reason could be that the input data and target labels were not properly prepared for the process, but it's unclear what the process actually requires.
When using a shape file as target labels the user can't select a column. This might be why the process fails, if the target label is a shape file with multiple columns.
In EIS Wizard it is not explained, how the input for Neurons should look like and no default is selected. An explanation for the user would be helpful.
How to reproduce the bug
Run "MLP - classifier" (or "MLP - regressor") with e.g. three inputs for evidence data. These rasters should be unified, masked and scaled to values from 0 to 1. For target labels use a raster with pixels of 0 (no deposit) and 1 (deposit) and the background NoData. Alternatively, a point set with multiple columns can be selected, with one column containing the labels 0 and 1. For neurons use 10 and leave the other parameters at their default.
Expected behavior
Process freezes at 90% and the following log is displayed:
QGIS version: 3.34.12-Prizren
QGIS code revision: eeb6af3638
Qt version: 5.15.13
Python version: 3.12.7
GDAL version: 3.9.3
GEOS version: 3.13.0-CAPI-1.19.0
PROJ version: Rel. 9.5.0, September 15th, 2024
PDAL version: 2.8.1 (git-version: a06325)
Algorithm started at: 2025-03-28T10:38:41
Algorithm 'MLP classifier' starting…
Input parameters:
{ 'activation' : 0, 'batch_size' : 32, 'dropout_rate' : None, 'early_stopping' : True, 'epochs' : 50, 'es_patience' : 5, 'input_rasters' : ['C:/Users/baer/Praktikum_Beak/EIS/EIS_Workshop_QGIS_Project/Proxies_unified_EISmasked_scaled/scaled_masked_Distance_to_K_anom_till_unified.tif','C:/Users/baer/Praktikum_Beak/EIS/EIS_Workshop_QGIS_Project/Proxies_unified_EISmasked_scaled/scaled_masked_Distance_to_Radiometric_Th_anomalies_unified.tif','C:/Users/baer/Praktikum_Beak/EIS/EIS_Workshop_QGIS_Project/Proxies_unified_EISmasked_scaled/scaled_masked_Distance_to_high_conductivity_anomalies_unified.tif'], 'last_activation' : 0, 'learning_rate' : 0.001, 'loss_function' : 0, 'neurons' : '10', 'optimizer' : 0, 'output_file' : 'TEMPORARY_OUTPUT', 'output_neurons' : 1, 'random_state' : None, 'target_labels' : 'C:/Users/baer/Praktikum_Beak/EIS/EIS_Workshop_QGIS_Project/Training_data/Training_data_rasterized_fill42_replace42nodata.tif', 'validation_metrics' : [0], 'validation_split' : 0.2 }
C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\geopandas_compat.py:112: UserWarning: The Shapely GEOS version (3.10.3-CAPI-1.16.1) is incompatible with the GEOS version PyGEOS was compiled with (3.10.4-CAPI-1.16.2). Conversions between both will be slow.
warnings.warn(
2025-03-28 10:38:44.086688: I tensorflow/core/util/port.cc:113] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\h5py_init_.py:36: UserWarning: h5py is running against HDF5 1.14.3 when it was built against 1.14.6, this may cause problems
warn(("h5py is running against HDF5 {0} when it was built against {1}, "
C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\h5py_init.py:36: UserWarning: h5py is running against HDF5 1.14.3 when it was built against 1.14.6, this may cause problems
warn(("h5py is running against HDF5 {0} when it was built against {1}, "
C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\h5py_init.py:36: UserWarning: h5py is running against HDF5 1.14.3 when it was built against 1.14.6, this may cause problems
warn(("h5py is running against HDF5 {0} when it was built against {1}, "
C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\h5py_init.py:36: UserWarning: h5py is running against HDF5 1.14.3 when it was built against 1.14.6, this may cause problems
_warn(("h5py is running against HDF5 {0} when it was built against {1}, "
WARNING:tensorflow:From C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\keras\src\losses.py:2976: The name tf.losses.sparse_softmax_cross_entropy is deprecated. Please use tf.compat.v1.losses.sparse_softmax_cross_entropy instead.
C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\h5py_init_.py:36: UserWarning: h5py is running against HDF5 1.14.3 when it was built against 1.14.6, this may cause problems
warn(("h5py is running against HDF5 {0} when it was built against {1}, "
C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\h5py_init.py:36: UserWarning: h5py is running against HDF5 1.14.3 when it was built against 1.14.6, this may cause problems
warn(("h5py is running against HDF5 {0} when it was built against {1}, "
C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\h5py_init.py:36: UserWarning: h5py is running against HDF5 1.14.3 when it was built against 1.14.6, this may cause problems
warn(("h5py is running against HDF5 {0} when it was built against {1}, "
C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\h5py_init.py:36: UserWarning: h5py is running against HDF5 1.14.3 when it was built against 1.14.6, this may cause problems
_warn(("h5py is running against HDF5 {0} when it was built against {1}, "
Progress: 30%
WARNING:tensorflow:From C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\keras\src\backend.py:873: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.
2025-03-28 10:38:49.792799: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: SSE SSE2 SSE3 SSE4.1 SSE4.2 AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Epoch 1/50
WARNING:tensorflow:From C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\keras\src\utils\tf_utils.py:492: The name tf.ragged.RaggedTensorValue is deprecated. Please use tf.compat.v1.ragged.RaggedTensorValue instead.
WARNING:tensorflow:From C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-packages\keras\src\engine\base_layer_utils.py:384: The name tf.executing_eagerly_outside_functions is deprecated. Please use tf.compat.v1.executing_eagerly_outside_functions instead.
1/1 [==============================] - ETA: 0s - loss: 0.6746 - accuracy: 0.6562
1/1 [==============================] - 1s 650ms/step - loss: 0.6746 - accuracy: 0.6562 - val_loss: 0.6759 - val_accuracy: 0.8750
Epoch 2/50
1/1 [==============================] - ETA: 0s - loss: 0.6734 - accuracy: 0.6562
1/1 [==============================] - 0s 33ms/step - loss: 0.6734 - accuracy: 0.6562 - val_loss: 0.6781 - val_accuracy: 0.8750
Epoch 3/50
1/1 [==============================] - ETA: 0s - loss: 0.6721 - accuracy: 0.6562
1/1 [==============================] - 0s 33ms/step - loss: 0.6721 - accuracy: 0.6562 - val_loss: 0.6802 - val_accuracy: 0.8750
Epoch 4/50
1/1 [==============================] - ETA: 0s - loss: 0.6709 - accuracy: 0.6562
1/1 [==============================] - 0s 33ms/step - loss: 0.6709 - accuracy: 0.6562 - val_loss: 0.6824 - val_accuracy: 0.8750
Epoch 5/50
1/1 [==============================] - ETA: 0s - loss: 0.6697 - accuracy: 0.7188
1/1 [==============================] - 0s 33ms/step - loss: 0.6697 - accuracy: 0.7188 - val_loss: 0.6845 - val_accuracy: 0.7500
Epoch 6/50
1/1 [==============================] - ETA: 0s - loss: 0.6684 - accuracy: 0.7500
1/1 [==============================] - 0s 34ms/step - loss: 0.6684 - accuracy: 0.7500 - val_loss: 0.6867 - val_accuracy: 0.5000
Progress: 80%
+--------------------- Traceback (most recent call last) ---------------------+
| C:\Users\baer\Praktikum_Beak\python_environments\EIS_env_py3913\lib\site-pa |
| ckages\eis_toolkit\cli.py:2717 in mlp_classifier_train_cli |
| |
| 2714 |
Progress: 80%
| 2716 |
| > 2717 save_model(model, output_file) |
| 2718 |
Progress: 90%
| 2720 |
| |
| +-------------------------------- locals ---------------------------------+ |
| | _ = array([ True, True, True, ..., True, True, | |
| | True]) | |
| | activation = <MLPActivationFunctions.relu: 'relu'> | |
| | batch_size = 32 | |
| | dropout_rate = None | |
| | early_stopping = True | |
| | epochs = 50 | |
| | es_patience = 5 | |
| | input_rasters = [ | |
Environment details
- OS: Windows
- Python version: 3.9.13
- QGIS version: 3.34.12
- EIS Toolkit version: 1.1.3
- EIS QGIS Plugin version: 1.0.3
- GDAL version: 3.8.4