<?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: Load a pyfunc model logged with Feature Store in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/load-a-pyfunc-model-logged-with-feature-store/m-p/38864#M2014</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for your message. Databricks made an example with a notebook (with dummy data) available how you can access and use these cases. This might gives a direction where to look for:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/_static/notebooks/machine-learning/feature-store-taxi-example.html" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/_static/notebooks/machine-learning/feature-store-taxi-example.html&lt;/A&gt;.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Hopefully this helps and else please send a message then I can have a look further.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2023 19:07:29 GMT</pubDate>
    <dc:creator>Siebert_Looije</dc:creator>
    <dc:date>2023-08-01T19:07:29Z</dc:date>
    <item>
      <title>Load a pyfunc model logged with Feature Store</title>
      <link>https://community.databricks.com/t5/machine-learning/load-a-pyfunc-model-logged-with-feature-store/m-p/38857#M2012</link>
      <description>&lt;P&gt;Hi, I'm using Databricks Feature Store to register a custom model using a model wrapper as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Log custom model to MLflow
fs.log_model(
  artifact_path="model",
  model = production_model,
  flavor = mlflow.pyfunc, 
  training_set = training_set,
  registered_model_name = model_name,
  conda_env=model_env
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The model is correctly serving and I can score batch using the model's uri:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;fs.score_batch('models:/model_name/latest',
                dataset,
                result_type = ArrayType(StringType()))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I can not do is to load the model using:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import mlflow
import databricks.feature_store
mlflow.pyfunc.load_model('models:/model_name/latest')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;I keep on getting the following error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ModuleNotFoundError: No module named 'databricks.feature_store.mlflow_model'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the correct way to load or log the model for this case?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 17:59:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/load-a-pyfunc-model-logged-with-feature-store/m-p/38857#M2012</guid>
      <dc:creator>SOlivero</dc:creator>
      <dc:date>2023-08-01T17:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Load a pyfunc model logged with Feature Store</title>
      <link>https://community.databricks.com/t5/machine-learning/load-a-pyfunc-model-logged-with-feature-store/m-p/38864#M2014</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks for your message. Databricks made an example with a notebook (with dummy data) available how you can access and use these cases. This might gives a direction where to look for:&amp;nbsp;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/_static/notebooks/machine-learning/feature-store-taxi-example.html" target="_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/_static/notebooks/machine-learning/feature-store-taxi-example.html&lt;/A&gt;.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Hopefully this helps and else please send a message then I can have a look further.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 19:07:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/load-a-pyfunc-model-logged-with-feature-store/m-p/38864#M2014</guid>
      <dc:creator>Siebert_Looije</dc:creator>
      <dc:date>2023-08-01T19:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Load a pyfunc model logged with Feature Store</title>
      <link>https://community.databricks.com/t5/machine-learning/load-a-pyfunc-model-logged-with-feature-store/m-p/38950#M2019</link>
      <description>&lt;P&gt;Thank you for the help!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I had already logged and score batch with my model. Nevertheless I can not do is to load the custom model object to another notebook with:&lt;/P&gt;&lt;PRE&gt;mlflow.pyfunc.load_model('models:/model_name/latest')&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Aug 2023 16:38:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/load-a-pyfunc-model-logged-with-feature-store/m-p/38950#M2019</guid>
      <dc:creator>SOlivero</dc:creator>
      <dc:date>2023-08-02T16:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Load a pyfunc model logged with Feature Store</title>
      <link>https://community.databricks.com/t5/machine-learning/load-a-pyfunc-model-logged-with-feature-store/m-p/39813#M2038</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/85726"&gt;@SOlivero&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;P&gt;Make sure that the model was in fact saved with the provided URI.&lt;/P&gt;&lt;P&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;latest&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;keyword will retrieve the latest version of the registered model when&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;mlflow.pyfunc.load_model('models:/model_name/latest')&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is executed, not the highest version. If you have not registered the model with the name&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;model_name&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in the models registry you can try to load it using the full path:&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;mlflow.pyfunc.load_model("file:///path/to/the/saved/model")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;where&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;/path/to/the/saved/model&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;represents the location where the model artifacts were saved during training (i.e the path where&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;mlflow.pyfunc.save_model()&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;was called during training).&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;P&gt;If this doesn't help, check that you can access the model outside of the notebook. You could also check that the Databricks cluster you're running on has access to the Databricks models registry if that is where your model was saved.&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 14 Aug 2023 07:15:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/load-a-pyfunc-model-logged-with-feature-store/m-p/39813#M2038</guid>
      <dc:creator>Kumaran</dc:creator>
      <dc:date>2023-08-14T07:15:31Z</dc:date>
    </item>
  </channel>
</rss>

