<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Register a ML model using MLflow in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/how-to-register-a-ml-model-using-mlflow/m-p/33543#M1771</link>
    <description>&lt;P&gt;I think you want to use mflow to load the model not pytorch.  There is a function in mlflow to load pytorch models &lt;A href="https://www.mlflow.org/docs/latest/python_api/mlflow.pytorch.html#mlflow.pytorch.load_model" target="test_blank"&gt;https://www.mlflow.org/docs/latest/python_api/mlflow.pytorch.html#mlflow.pytorch.load_model&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Then once it's loaded, you can log it and register it as normal.  &lt;/P&gt;</description>
    <pubDate>Thu, 09 Dec 2021 13:07:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-12-09T13:07:19Z</dc:date>
    <item>
      <title>How to Register a ML model using MLflow</title>
      <link>https://community.databricks.com/t5/machine-learning/how-to-register-a-ml-model-using-mlflow/m-p/33541#M1769</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a PyTorch model which I have pushed into the&amp;nbsp;dbfs&amp;nbsp;now I want to serve the model using MLflow. I saw that the model needs to be in&amp;nbsp;python_function model.&lt;/P&gt;&lt;P&gt;To do that I did the following methods&lt;/P&gt;&lt;P&gt;1. load the model from dbfs using torch load option&lt;/P&gt;&lt;P&gt;2. Then save the model in python_function model using the pyfunc.save_model function&lt;/P&gt;&lt;P&gt;3. After this when I register the model I get a decode error&lt;/P&gt;&lt;P&gt;I'm not training any model in the Databricks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import mlflow
import mlflow.pyfunc
from torch import load as torch_load
&amp;nbsp;
py_model = torch_load( "/dbfs/FileStore/ml/ner_model" , map_location = torch_device(ner_gpu_device))
mlflow.pytorch.save_model(py_model,path="/dbfs/FileStore/pyfunc/ner_model")
&amp;nbsp;
model = mlflow.pyfunc.load_model("/dbfs/FileStore/pyfunc/ner_model")
mlflow.register_model(model,"ner_model")
&amp;nbsp;
# loading the python_function model to register
model = mlflow.pyfunc.load_model("/dbfs/FileStore/pyfunc/ner_model")
model_version = mlflow.register_model(model,"ner_model")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="error message"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/2256i45D343017F9CF75D/image-size/large?v=v2&amp;amp;px=999" role="button" title="error message" alt="error message" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 16:49:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/how-to-register-a-ml-model-using-mlflow/m-p/33541#M1769</guid>
      <dc:creator>Itachi_Naruto</dc:creator>
      <dc:date>2021-12-08T16:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Register a ML model using MLflow</title>
      <link>https://community.databricks.com/t5/machine-learning/how-to-register-a-ml-model-using-mlflow/m-p/33543#M1771</link>
      <description>&lt;P&gt;I think you want to use mflow to load the model not pytorch.  There is a function in mlflow to load pytorch models &lt;A href="https://www.mlflow.org/docs/latest/python_api/mlflow.pytorch.html#mlflow.pytorch.load_model" target="test_blank"&gt;https://www.mlflow.org/docs/latest/python_api/mlflow.pytorch.html#mlflow.pytorch.load_model&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Then once it's loaded, you can log it and register it as normal.  &lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 13:07:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/how-to-register-a-ml-model-using-mlflow/m-p/33543#M1771</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-09T13:07:19Z</dc:date>
    </item>
  </channel>
</rss>

