python - Amazon SageMaker 中的 Tensorflow 服务

标签 python amazon-web-services tensorflow tensorflow-serving amazon-sagemaker

我在 AWS SageMaker 上提供 tensorflow 模型时遇到问题。我已经在 SageMaker 环境之外训练了模型,现在我有一个 savingmodel.pb 文件,我需要将其部署在 SageMaker 端点上。因此,我只是压缩模型文件并将其上传到 S3 存储桶。 现在,当尝试创建端点时,我在 Cloudwatch 日志中收到以下错误:

tensorflow_serving/sources/storage_path/file_system_storage_path_source.cc:369] FileSystemStoragePathSource encountered a file-system access error: Could not find base path /opt/ml/model/export/Servo for servable generic_model

我相信 SageMaker 正在寻找 tar.gz 来遵循特定的目录结构。但是,我只有一个 .pb 文件。

最佳答案

TensorFlow Serving 需要以下文件夹结构:

export/Servo/{version_number},其中版本号是任何有效的正数。

SageMaker 需要与 TFS 相同的目录格式,存在与此相关的 GH 问题 https://github.com/aws/sagemaker-python-sdk/issues/599

关于python - Amazon SageMaker 中的 Tensorflow 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54630690/

相关文章:

python - 比较 SQLite 查询中两个可能为 NULL 的值

amazon-web-services - ~30 秒后 AWS API 网关超时

python - 如何在 TensorFlow 2 中重置初始化

python - 为 tf.while_loop 的每个时间步计算梯度

python - Python 上美国格式的周数

python - 在 python 中转换列表的优雅且廉价的方法

amazon-web-services - 运行任务 : No Container Instances were found in your cluster 时出现 AWS ECS 错误

python - 优化 tf.map_fn 的 GPU 使用

python - 使用 scikit-learn 线性 SVM 提取决策边界

Redshift 的 REST API