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
질문됨 2년 전116회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠