I am using MLFLow to store my old models. I have a large number of models that I would like to register using MLFlow API so that I can version my models for new experiments/runs. For each model, I want to create a new run so that I can manage the runs and models inside it independently. For the first try in the loop, it works smoothly. But, when I repeat the for loop, it throws an error:
Error in curl::curl_fetch_memory(url, handle = handle):
HTTP/2 stream 5 was not closed cleanly before end of the underlying stream
Current code:
for (model in old_models) {
run <- mlflow_start_run()
run_id <- run$run_uuid
logged_model <- mlflow_log_model(model$crate_object, artifact_path = "model")
registered_model <- mlflow_create_registered_model(name = model$model_name)
mlflow_end_run(run_id = run_id)
}
When the for loop was completed first time, all models were correctly created and stored. When I tried to rerun the forloop, it shows the above error. Any suggestion or pointer?