mlflow / mlflow-export-import

Apache License 2.0
131 stars 77 forks source link

Model versions are not registered although model is created and experiments/runs are imported #165

Open captify-ffonseca opened 8 months ago

captify-ffonseca commented 8 months ago

My model versions are not being created after running import-models. It imports experiments, and creates the models, however, no model versions are registered.

source Tracking Server

image

destination Tracking Server

image

Any idea what could be causing this? a mismatch between source and destination mlflow version?

captify-ffonseca commented 8 months ago

I was able to import the versions, however, I had to make some slight changes to the source code.

First, dst_source wasn't being properly generated, in my use case. https://github.com/mlflow/mlflow-export-import/blob/cffdb4410098503ca8b75a11e039473fda594021/mlflow_export_import/model/import_model.py#L291-L295

Example: model_path -> <src-experiment-id>/<src-run-id>/artifacts/<artifact_name> dst_artifact_uri -> s3://bucket_name/mlflow/artifacts/<dst-experiment-id>/<dst-run-id>/artifacts/

as such, dst_source ended up as: s3://bucket_name/mlflow/artifacts/<dst-experiment-id>/<dest-run-id>/artifacts/<src-experiment-id>/<src-run-id>/artifacts/<artifact_name> which is not a valid S3 location.

The correct path would be: s3://bucket_name/mlflow/artifacts/<dst-experiment-id>/<dst-run-id>/artifacts/<artifact_name>

I changed how model_path is obtained to reflect that.

image

After that was done, the following snippet gave me problems:

https://github.com/mlflow/mlflow-export-import/blob/cffdb4410098503ca8b75a11e039473fda594021/mlflow_export_import/model_version/import_model_version.py#L108-L109

As S3 is the filesystem in use, the dbfs: check will be False, and os.path.exists also False, leading to the MlflowExportImportException being raised.

Once this check was commented out, the importing worked, and model versions were created.