cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
cancel
Showing results for 
Search instead for 
Did you mean: 

Save ML model in the registry fails

pablobd
Contributor

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
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
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! 
 

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.