mllam / neural-lam

Research Software for Neural Weather Prediction for Limited Area Modeling
https://join.slack.com/t/ml-lam/shared_invite/zt-2t112zvm8-Vt6aBvhX7nYa6Kbj_LkCBQ
MIT License
119 stars 48 forks source link

Numpy 2 compatability #67

Closed joeloskarsson closed 3 months ago

joeloskarsson commented 3 months ago

Nerual-lam is at the moment not completely compatible with the new release of numpy 2. At the moment the requirements specification includes numpy 2, so that is what will be installed when installing neural-lam.

While the upgrade to numpy 2 compatability is likely not huge, it is also not urgent. It is still good to first prevent this issue by changing the dependency specifier, and then we can put it on the roadmap to upgrade.

Things TODO:

joeloskarsson commented 3 months ago

One error message we get with numpy 2 is "Alias np.float_ has been removed. Use np.float64 instead." (from @sadamov)

joeloskarsson commented 3 months ago

@sadamov Do you remember any more information about where you ran into Alias np.float_ has been removed. Use np.float64 instead.? I managed to run training and testing successfully on CPU with numpy 2.0.1. Was that error from some of the pre-processing scripts? (I have not tried them yet)

sadamov commented 3 months ago

I have run all pre-processing scripts and the model training with the latest env from https://github.com/mllam/neural-lam/pull/32. Tested both on CPU/GPU to be sure, no issues. So this must mean that I was previously working with a dirty environment. Sometimes I managed to install numpy<2.0.0 with mamba and numpy>2.0.0 with pip on top. Probably some libraries in my env were still built against numpy=1.2.6 as a result. I apologies for wasting our time and suggest to close this issue. I will update my comment in https://github.com/mllam/neural-lam/pull/37 and reference this issue.

joeloskarsson commented 3 months ago

Ok, great! I still think it was good to look into this and make sure that everything works with 2.0.

For completion: