【发布时间】:2021-03-04 20:03:55
【问题描述】:
我正在尝试使用 BlazingText 模型在 Sagemaker 上运行监督模型。这是我用于运行估计器、超参数调整、部署到容器和模型调用的代码。我看到“属性错误:无法设置属性”。
bt = sagemaker.estimator.Estimator(container,
role,
instance_count=1,
instance_type='ml.m5.large',
input_mode='File',
output_path=s3_output_location)
bt.set_hyperparameters(mode='supervised')
Code for model tuning
bt.fit(inputs=s3_channels)
Code to deploy to container
customer_entity = bt.deploy(initial_instance_count=1, instance_type='ml.t2.medium')
Invoking the model
customer_entity.content_type = 'application/json'
response = customer_entity.predict(json.dumps(payload))
Error
AttributeError Traceback (most recent call last)
in
----> 1 customer_entity.content_type = 'application/json'
2 response = customer_entity.predict(json.dumps(payload))
3 #response = customer_entity.predict(payload)
AttributeError: can't set attribute
【问题讨论】:
标签: python nlp artificial-intelligence amazon-sagemaker