Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model loading #118

Open
Etienne-Meunier opened this issue May 21, 2024 · 1 comment
Open

Model loading #118

Etienne-Meunier opened this issue May 21, 2024 · 1 comment

Comments

@Etienne-Meunier
Copy link

Hi,

Thank you for your great work ! I am trying to load your model to make inference in python on new fields using the weights trained for the paper although I have a few errors.

Trying to use src/gz21_ocean_momentum/__init__.py however It cannot find the file final_transformation.pth.

Similarly if I run :

MODEL_RUN_ID = "dc74cea68a7f4c7e98f9228649a97135"
client = mlflow.tracking.MlflowClient()
model_file = client.download_artifacts(MODEL_RUN_ID, "models/trained_model.pth")

I get :

MlflowException: Run 'dc74cea68a7f4c7e98f9228649a97135' not found

Thanks !

@raehik
Copy link
Contributor

raehik commented Jul 1, 2024

That snippet is trying to load model weights from an MLflow run dc74... that doesn't exist on your local machine.

I don't believe I was using __init__.py in my later changes. Try using cli/infer.py, as in the Predicting using the trained model section of the readme. (I think I kept it around because it was used in some Jupyter notebooks which I wasn't able to refactor before leaving.)

There's a good chance you would need to do more work or edit some of the code if you're trying to infer forcings for different fields. I'm not active on this project anymore, but if you can add a bit more detail on what you're trying to do, myself or someone else might be able to help further.

@raehik raehik removed their assignment Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants