Way*_* Yu 6 python machine-learning amazon-sagemaker
我正在尝试按照此处的教程来实现用于特征预处理的自定义推理管道。它使用 python sklearn sdk 从脚本中引入自定义预处理管道。例如:
from sagemaker.sklearn.estimator import SKLearn
script_path = 'preprocessing.py'
sklearn_preprocessor = SKLearn(
entry_point=script_path,
role=role,
train_instance_type="ml.c4.xlarge",
sagemaker_session=sagemaker_session)
Run Code Online (Sandbox Code Playgroud)
但是我找不到发送多个文件的方法。我需要多个文件的原因是因为我有一个在 sklearn 管道中使用的自定义类需要从自定义模块导入。如果不导入,AttributeError: module '__main__' has no attribute 'CustomClassName'
由于pickle 的工作方式(至少我认为它与pickle 相关),在同一个preprocessing.py 文件中包含自定义类时会引发错误。
有谁知道是否可以发送多个文件?
Sagemaker 新手,谢谢!!