How to use custom functions for a model in a Sagemaker pipeline?

0

If I want to use a custom function transformer in preprocessing, how do I ensure that it's detected at both pipeline building and deployment?

I'm building a sklearn pipeline, and in preprocessing I use a custom FunctionTransformer. In Sagemaker, I am able to train, evaluate, and register the model, but get the below error when I try to deploy it: AttributeError: Can't get attribute 'truncate_function' on <module '__main__' from '/miniconda3/bin/gunicorn'>

I've tried putting the functions into a helper.py file, and including it as a dependency during training, but then get the following error when evaluating in a ProcessingStep: "ModuleNotFoundError: No module named 'helper'.

dxu271
preguntada hace 2 años116 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas