我正在遵循本教程来尝试并部署我自己以前训练过的模型,我将其工件存储在存储在S3存储桶(https://aws.amazon.com/blogs/machine-learning/object-detection-and-model-retraining-with-amazon-sagemaker-and-amazon-augmented-ai/)中的tar.gc文件中。
在我读到代码的这一点之前,一切似乎都运行得很好:
# deploying the model into one ml.m4.xlarge instance
object_detector = model.deploy(initial_instance_count = 1,
instance_type = 'ml.m4.xlarge',
endpoint_name = endpoint_name)它为我指出了这个错误:
ClientError: An error occurred (ValidationException) when calling the CreateModel operation: 2 validation errors detected: Value 'model.tar.gz-2021-08-26-08-43-29-384' at 'modelName' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*; Value '685385470294.dkr.ecr.eu-west-1.amazonaws.com/object-detection:1' at 'primaryContainer.modelDataUrl' failed to satisfy constraint: Member must satisfy regular expression pattern: ^(https|s3)://([^/]+)/?(.*)$
我检查了它似乎引用的属性,它们是:
model.model_data'685385470294.dkr.ecr.eu-west-1.amazonaws.com/object-detection:1'
和
model.name'model.tar.gz-2021-08-26-08-43-29-384'
但我不确定问题应该是什么。在前面的演示中,它似乎希望将tar.gc文件从输出位置复制到另一个位置,我不明白这有什么意义。它就不能停留在/output中的原处吗?我只是将它复制到训练后存放的文件夹下的一个子目录中,如果这有帮助的话。例如S3/文件夹/输出模型S3/文件夹/输出/ -> /
发布于 2021-08-26 13:20:48
我不是专家,但你得到的错误似乎是相当清楚的。模型名称不能包含点来查看预期的正则表达式,我不知道它是从哪里来的,但是使用文件名似乎是不被允许的。第二个错误与此类似,模型网址必须以https或S3之类的网络协议开头。看看代码的其余部分,或者这些东西的定义位置。
https://stackoverflow.com/questions/68935545
复制相似问题