question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mlflow + pytorch lightning not able to log custom models

See original GitHub issue

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):
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • MLflow installed from (source or binary):
  • MLflow version (run mlflow --version):
  • Python version:
  • npm version, if running the dev UI:
  • Exact command to reproduce:

Describe the problem

Describe the problem clearly here. Include descriptions of the expected behavior and the actual behavior.

Code to reproduce issue

Provide a reproducible test case that is the bare minimum necessary to generate the problem.

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

I am using a custom pytorch lightning trainer with mlflow logger MLFlowLogger(experiment_name=“Experiment”, tracking_uri=tracking_uri)

I use both mlflow.pytorch.autolog()

and the logger - which saves the parameters in default run and metrics in the run in “Experiment”. However it does not log the model which i want to use for serving, it gives the following error:

image

Is it that pltrainer models are not supported? My model has single inputs and multiple outputs.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
piseabhijeetcommented, Sep 14, 2021

Yes, i want to make tensorflow-pytorch compatible training pipeline.

1reaction
jwyyycommented, Sep 13, 2021

Can you provide more code? I am not able to identity the problem based on this screenshot. You can find some posts related to the error: link1 and link2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mlflow.pytorch — MLflow 2.0.1 documentation
Log a PyTorch model as an MLflow artifact for the current run. Log the model with a signature to avoid inference errors. If...
Read more >
How to log custom Pytorch model with Mlflow? - Stack Overflow
I want to use mlflow.pytorch.log_model to save the model as a native pytorch model. But trainer is not a torch.nn.Module .
Read more >
mlflow — PyTorch Lightning 1.8.5.post0 documentation
Logger. Log using MLflow. Install it with pip: pip install mlflow ... If not provided, defaults to MLFLOW_TRACKING_URI environment variable if set, ...
Read more >
Best practices for deep learning on Databricks
The preconfigured Databricks runtime makes it possible to easily scale common ... MLflow can log any deep learning model, including custom ...
Read more >
TorchScript — PyTorch 1.13 documentation
This makes it possible to train models in PyTorch using familiar tools in Python and ... a single function and does not have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found