尝试为sklearn估计器的批处理转换过程定义转换器时,出现错误

时间:2019-09-03 13:20:17

标签: scikit-learn amazon-sagemaker

当尝试为sklearn估计器的批处理转换过程定义转换器时,出现以下错误:TypeError: init ()获得了多个参数'entry_point'“

的值

这些是我遵循的步骤:

步骤1:

def post_filter(request, page_id):
    if request.method == 'POST':
        posts = BlogPage.objects.get(id=page_id).getChildren()
        print (posts)

步骤2:

from sagemaker.sklearn.estimator import SKLearn

script_path = 'transformer.py'

sklearn_preprocessor = SKLearn(
    entry_point=script_path,
    role=role,
    train_instance_type="ml.c4.xlarge",
    sagemaker_session=sagemaker_session)

培训成功。

步骤3:

sklearn_preprocessor.fit({'train': "s3://training-data/train.csv"})

第3步出错:

transformer = sklearn_preprocessor.transformer(
    instance_count=1, 
    instance_type='ml.m4.xlarge',
    assemble_with = 'Line',
    output_path='s3://training-data/transformed.csv',
    accept = 'text/csv')

1 个答案:

答案 0 :(得分:0)

该问题已报告给AWS Sagemaker Python SDK的Github存储库     https://github.com/aws/sagemaker-python-sdk/issues/974

该问题似乎已通过PR https://github.com/aws/sagemaker-python-sdk/pull/978解决。 查看CHANGELOG,此修复程序在v1.36.3版本中发布。将SDK更新到更高版本应该可以解决该问题