m2lines / gz21_ocean_momentum

Stochastic-Deep Learning Parameterization of Ocean Momentum Forcing
MIT License
5 stars 1 forks source link

Inference step fails #91

Closed arthurBarthe closed 11 months ago

arthurBarthe commented 1 year ago

The final step (following data-processing step and training step) consists of carrying out inference using the trained neural network on global data from the data-processing step. Currently this fails. In particular, I get the following error:

Traceback (most recent call last): File "/share/apps/centos7/anaconda3/2021.11/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/share/apps/centos7/anaconda3/2021.11/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/data/home/ahw795/GZ21_ocean_momentum_CNN/src/gz21_ocean_momentum/testing/main.py", line 86, in <module> models_experiment_id, _ = select_experiment() File "/data/home/ahw795/GZ21_ocean_momentum_CNN/src/gz21_ocean_momentum/utils.py", line 46, in select_experiment list_of_exp = client_.list_experiments() AttributeError: 'MlflowClient' object has no attribute 'list_experiments'

This is likely due to a change in the Mlflow API. @MarionBWeinzierl did you not face a similar issue when running the jupyter notebooks, as they use the select_experiment as well?

MarionBWeinzierl commented 1 year ago

Yes, I had to change some things to make it run. This bit was in utils.py, mainly changing line 46 to: https://github.com/m2lines/gz21_ocean_momentum/blob/d461375a134683a7ac3d2b99ca41dfa9c5382ca2/src/gz21_ocean_momentum/utils.py#L46 if I remember correctly.

Also, you have to call the function as exp_id, exp_name = select_experiment(), i.e., two output parameters

arthurBarthe commented 1 year ago

Thanks!