我在 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/