如何解决直接从模型工件进行部署
我想在Sagemaker上部署预训练的神经网络作为端点。我所有的模型工件都存储在S3中。
在Sagemacer文档(here)中,我找到了以下解决方案:
from sagemaker.tensorflow import TensorFlowModel
model = TensorFlowModel(model_data='s3://mybucket/model.tar.gz',role='MySageMakerRole')
predictor = model.deploy(initial_instance_count=1,instance_type='ml.c5.xlarge')
我像这样修改了TensorFlowModel()函数:
from sagemaker.tensorflow import TensorFlowModel
from sagemaker import get_execution_role
role = get_execution_role()
tensorflow_model = TensorFlowModel(model_data='s3://my-bucket-name/path_to_the_model/model.tar.gz',role=role,framework_version='2.1.0')
这导致了错误: TypeError: init ()缺少1个必需的位置参数:“ entry_point”
sagemaker.tensorflow.model.TensorFlowModel()(here)的文档说明了参数输入点:
entry_point(str)-Python源文件的路径(绝对或相对),应作为模型托管的入口点执行。如果指定了source_dir,则entry_point必须指向位于source_dir根目录下的文件。
文档是错误的,还是我的代码和文档中的示例之间缺少主要区别?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。