cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Save ML model in the registry fails

pablobd
Contributor II

Using `mlflow.pyfunc.log_model` to save a model in the model registry fails with the following error: `PicklingError: Can't pickle <built-in function input>: it's not the same object as builtins.input`

I've reproduced it locally and got to the conclusion that it comes because I am using `boto3.resource("dynamodb")` - this is because DynamoDB provides features at inference time. Using the online feature store (also with DynamoDB) may work but it's not my preferred solution.

Do you know any workaround? 

Thanks

2 REPLIES 2

Kaniz_Fatma
Community Manager
Community Manager

Hi @pablobd, It seems like the boto3.resource("dynamodb") object is causing the issue.

 

One possible workaround is to use a custom PyFunc model. In a custom PyFunc model, you can define your own logic for loading and using the model, which could include creating the boto3.resource("dynamodb") object at runtime, rather than trying to serialize it with the model.

 

Please let me know if you need further assistance! ๐Ÿ˜Š

Kaniz_Fatma
Community Manager
Community Manager

Thank you for posting your question in our community! We are happy to assist you.

To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?

This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance! 
 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group