DassHydro / smash

An open source, Python library interfacing the Fortran Spatially distributed Modelling and ASsimilation for Hydrology platform.
https://smash.recover.inrae.fr/
GNU General Public License v3.0
12 stars 6 forks source link

Lack of warning or error when launching an ANN optimisation without having entered the necessary descriptor information in setup. #117

Closed ThomasdeFournas closed 10 months ago

ThomasdeFournas commented 10 months ago

This is what you can find in the output instead of an error (Missing information) :

</> Optimize Traceback (most recent call last): File "/home/RHAX/UTILISATEURS/thomas.defournas/Documents/Explore/VERSION.1.0.x/test_run.py", line 30, in net=model.optimize(mapping="ann",cost_options={"jobs_cmpt":["kge", "kge"], "jobs_cmpt_tfm":["keep", "inv"] },optimize_options={"learning_rate": 0.0025, "termination_crit": {"epochs": 100, "early_stopping": 10}}, return_options={"net": True} , common_options={"ncpu":10}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/local/AIX/tdefournas/anaconda3/envs/smash-dev/lib/python3.11/site-packages/smash/core/model/model.py", line 2217, in optimize return _optimize(self, *args) ^^^^^^^^^^^^^^^^^^^^^^ File "/local/AIX/tdefournas/anaconda3/envs/smash-dev/lib/python3.11/site-packages/smash/core/simulation/optimize/optimize.py", line 538, in _optimize net = _ann_optimize( ^^^^^^^^^^^^^^ File "/local/AIX/tdefournas/anaconda3/envs/smash-dev/lib/python3.11/site-packages/smash/core/simulation/optimize/optimize.py", line 634, in _ann_optimize net._fit_d2p( File "/local/AIX/tdefournas/anaconda3/envs/smash-dev/lib/python3.11/site-packages/smash/factory/net/net.py", line 338, in _fit_d2p self._compile( File "/local/AIX/tdefournas/anaconda3/envs/smash-dev/lib/python3.11/site-packages/smash/factory/net/net.py", line 312, in _compile layer._initialize(opt) File "/local/AIX/tdefournas/anaconda3/envs/smash-dev/lib/python3.11/site-packages/smash/factory/net/_layers.py", line 206, in _initialize _wb_initialization(self, "weight") File "/local/AIX/tdefournas/anaconda3/envs/smash-dev/lib/python3.11/site-packages/smash/factory/net/_layers.py", line 122, in _wb_initialization limit = np.sqrt(6 / (fin + fout)) ^~~~ ZeroDivisionError: division by zero

nghi-truyen commented 10 months ago

Resolved in PR #118.