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

[BUG] MLflow R SDK mlflow_create_model_version params not passed correctly to rest client #5057

Closed
3 of 23 tasks
singankit opened this issue Nov 12, 2021 · 4 comments
Closed
3 of 23 tasks
Labels
Acknowledged This issue has been read and acknowledged by the MLflow admins. area/model-registry Model registry, model registry APIs, and the fluent client calls for model registry bug Something isn't working help wanted We would like help from the community to add this support language/r R APIs and clients

Comments

@singankit
Copy link
Contributor

Thank you for submitting an issue. Please refer to our issue policy for additional information about bug reports. For help with debugging your code, please refer to Stack Overflow.

Please fill in this bug report template to ensure a timely and thorough response.

Willingness to contribute

The MLflow Community encourages bug fix contributions. Would you or another member of your organization be willing to contribute a fix for this bug to the MLflow code base?

  • Yes. I can contribute a fix for this bug independently.
  • Yes. I would be willing to contribute a fix for this bug with guidance from the MLflow community.
  • No. I cannot contribute a bug fix at this time.

System information

  • Have I written custom code (as opposed to using a stock example script provided in MLflow): No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): All Platforms
  • MLflow installed from (source or binary): MLflow R SDK from https://cloud.r-project.org/
  • MLflow version (run mlflow --version): 1.20.2
  • Python version: NA
  • npm version, if running the dev UI: NA
  • Exact command to reproduce: mlflow_create_model_version(name="test_model", source=run$artifact_uri, "/model")

Describe the problem

In MLflow R SDK mlflow_create_model_version fails with error test_model artifact path does not exists. This issue is that the parameter source in mlflow_create_model_version is not passed properly to mlflow_rest

Code to reproduce issue

Following code taken from an Mlflow R sample example

library(mlflow)
library(glmnet)

system("which mlflow")

# Read the wine-quality csv file
data <- read.csv("wine-quality.csv")

# Split the data into training and test sets. (0.75, 0.25) split.
sampled <- sample(1:nrow(data), 0.75 * nrow(data))
train <- data[sampled, ]
test <- data[-sampled, ]

# The predicted column is "quality" which is a scalar from [3, 9]
train_x <- as.matrix(train[, !(names(train) == "quality")])
test_x <- as.matrix(test[, !(names(train) == "quality")])
train_y <- train[, "quality"]
test_y <- test[, "quality"]

alpha <- mlflow_param("alpha", 0.5, "numeric")
lambda <- mlflow_param("lambda", 0.5, "numeric")

with(mlflow_start_run(), {
  model <- glmnet(train_x, train_y, alpha = alpha, lambda = lambda, family = "gaussian")
  predictor <- crate(~ glmnet::predict.glmnet(model, as.matrix(.x)), model)
  predicted <- predictor(test_x)
  mlflow_log_model(predictor, "model")
  mlflow_create_model_version(name="test_model", source= run$artifact_uri, "/model")
})

This example fails with error

Other info / logs

Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.

What component(s), interfaces, languages, and integrations does this bug affect?

Components

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/projects: MLproject format, project running backends
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/server-infra: MLflow Tracking server backend
  • area/tracking: Tracking Service, tracking client APIs, autologging

Interface

  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

Language

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

Integrations

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations
@singankit singankit added the bug Something isn't working label Nov 12, 2021
@github-actions github-actions bot added area/model-registry Model registry, model registry APIs, and the fluent client calls for model registry language/r R APIs and clients labels Nov 12, 2021
@lorenzwalthert
Copy link
Contributor

Thanks @singankit. Looks like you have correctly identified the bug. Would b great if you can create a PR to fix it and add a test to demonstrate the correct behaviour.

@ankit-db ankit-db added the Acknowledged This issue has been read and acknowledged by the MLflow admins. label Nov 19, 2021
@dbczumar dbczumar added the help wanted We would like help from the community to add this support label Nov 19, 2021
@dbczumar
Copy link
Collaborator

Hi @singankit , we'd be very excited about your contribution of a fix for this issue. Please feel free to file a PR, and let me know if you have any questions about the implementation. Thank you in advance!

@bramrodenburg
Copy link
Contributor

Issue is now fixed here: #5185

@singankit
Copy link
Contributor Author

Thanks @bramrodenburg for the fix. Closing this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Acknowledged This issue has been read and acknowledged by the MLflow admins. area/model-registry Model registry, model registry APIs, and the fluent client calls for model registry bug Something isn't working help wanted We would like help from the community to add this support language/r R APIs and clients
Projects
None yet
Development

No branches or pull requests

5 participants