无法使用 Unified Cloud AI Platform 自定义容器创建端点

问题描述

由于某些 VPC 限制,我被迫使用自定义容器对在 Tensorflow 上训练的模型进行预测。根据 documentation 要求,我使用 Tensorflow Serving 创建了一个 HTTP 服务器。用于build镜像的 Dockerfile 如下:

FROM tensorflow/serving:2.4.1-gpu

# copy the model file
ENV MODEL_NAME=my_model
copY my_model /models/my_model

其中 my_model 包含名为 saved_model文件夹中的 1/

然后我将此映像推送到 Google 容器存储库,然后通过使用 Model 并将 Import an existing custom container 更改为 8501 创建了一个 Port。但是,当尝试将模型部署到使用 n1-standard-16 类型的单个计算节点和 1 个 P100 GPU 的端点部署遇到以下错误

Failed to create session: Internal: cudaGetDevice() Failed. Status: CUDA driver version is insufficient for CUDA runtime version

我无法弄清楚这是怎么发生的。我能够在本地机器上运行相同的 docker 镜像,并且能够通过点击创建的端点成功获得预测:http://localhost:8501/v1/models/my_model:predict

在这方面的任何帮助将不胜感激。

解决方法

问题已通过将 Tensorflow serving 图像降级到 2.3.0-gpu 版本解决。根据错误上下文,自定义模型映像中的 CUDA 驱动程序与 GCP AI Platform 训练集群中的相应驱动程序版本不匹配。