[BUG] Loading Pyfunc artifact from pre- saved model uses Windows path format instead of linux. #11862
Open
4 of 23 tasks
Labels
area/artifacts
Artifact stores and artifact logging
area/docker
Docker use anywhere, such as MLprojects and MLmodels
area/windows
Issue is unique to windows.
bug
Something isn't working
Issues Policy acknowledgement
Where did you encounter this bug?
Local machine
Willingness to contribute
Yes. I would be willing to contribute a fix for this bug with guidance from the MLflow community.
MLflow version
System information
Describe the problem
I am trying to containerize a Pytorch ML model that is trained and saved locally using a custom wrapper of PythonModel to save some artifacts (scaler, hyperparameters, intermediate predictions)
However, when re-loading the model in the container, the artifact paths are clearly reloaded using a mix of Windows and Linux directory separators. This raises a FileNotFoundError exception.
What is a clean way to fix this behavior? Should I try to save the model differently during training? Or maybe a path fix should be implemented when moving across platforms
Tracking information
System information: Linux #1 SMP Thu Jan 11 04:09:03 UTC 2024
Python version: 3.11.9
MLflow version: 2.12.1
MLflow module location: /usr/local/lib/python3.11/site-packages/mlflow/init.py
Tracking URI: http://localhost:5002
Registry URI: http://localhost:5002
MLflow environment variables:
MLFLOW_HOST: 0.0.0.0
MLFLOW_PORT: 5002
MLFLOW_TRACKING_URI: http://localhost:5002
MLflow dependencies:
Flask: 3.0.3
Jinja2: 3.1.3
alembic: 1.13.1
click: 8.1.7
cloudpickle: 3.0.0
docker: 7.0.0
entrypoints: 0.4
fastapi: 0.110.2
gitpython: 3.1.43
graphene: 3.3
gunicorn: 21.2.0
importlib-metadata: 7.1.0
markdown: 3.6
matplotlib: 3.8.4
numpy: 1.26.3
packaging: 23.2
pandas: 2.2.0
protobuf: 5.26.1
pyarrow: 15.0.2
pydantic: 2.6.4
pytz: 2024.1
pyyaml: 6.0.1
querystring-parser: 1.2.4
requests: 2.31.0
scikit-learn: 1.4.0
scipy: 1.12.0
sqlalchemy: 2.0.27
sqlparse: 0.5.0
uvicorn: 0.29.0
Code to reproduce issue
Stack trace
Other info / logs
What component(s) does this bug affect?
area/artifacts
: Artifact stores and artifact loggingarea/build
: Build and test infrastructure for MLflowarea/deployments
: MLflow Deployments client APIs, server, and third-party Deployments integrationsarea/docs
: MLflow documentation pagesarea/examples
: Example codearea/model-registry
: Model Registry service, APIs, and the fluent client calls for Model Registryarea/models
: MLmodel format, model serialization/deserialization, flavorsarea/recipes
: Recipes, Recipe APIs, Recipe configs, Recipe Templatesarea/projects
: MLproject format, project running backendsarea/scoring
: MLflow Model server, model deployment tools, Spark UDFsarea/server-infra
: MLflow Tracking server backendarea/tracking
: Tracking Service, tracking client APIs, autologgingWhat interface(s) does this bug affect?
area/uiux
: Front-end, user experience, plotting, JavaScript, JavaScript dev serverarea/docker
: Docker use across MLflow's components, such as MLflow Projects and MLflow Modelsarea/sqlalchemy
: Use of SQLAlchemy in the Tracking Service or Model Registryarea/windows
: Windows supportWhat language(s) does this bug affect?
language/r
: R APIs and clientslanguage/java
: Java APIs and clientslanguage/new
: Proposals for new client languagesWhat integration(s) does this bug affect?
integrations/azure
: Azure and Azure ML integrationsintegrations/sagemaker
: SageMaker integrationsintegrations/databricks
: Databricks integrationsThe text was updated successfully, but these errors were encountered: