这个问题可能是因为Sagemaker的运行实例数与默认限制不符导致的,可以通过以下代码更新运行实例数限制:
import boto3
# Update Resource Limits
client = boto3.client('service-quotas')
response = client.request_service_quota_increase(
ServiceCode='sagemaker',
QuotaCode='L-776C2EFC',
DesiredValue=20
)
print(response)
其中QuotaCode
的值为运行实例数的限制,在这个代码示例中对应的是'L-776C2EFC'
,在实际使用时可能会不同。将DesiredValue
的值更新为所需的实例数极限,并执行该代码即可更新限制。