我刚开始使用顶点ai与谷歌云控制台。我正在尝试将此模式部署到端点。https://tfhub.dev/tensorflow/efficientnet/lite0/feature-vector/2
我成功地将它导入到一个google存储桶中,并将其上传到模型注册表。然而,当我尝试将模型部署到端点时,我收到以下错误:
Due to an error, Vertex AI was unable to create endpoint "Feature Vectors". Additional Details: Operation State: Failed with errors Resource Name: **path to project** Error Messages: Model server terminated: model server container terminated: exit_code: 255 reason: "Error" started_at { seconds: 1669817118 } finished_at { seconds: 1669817421 } . Model server logs can be found at **some link**
我已经尝试导出Tensorflow版本2.8和2.1。
我尝试将保存模型文件夹的桶导入模型注册表,我还尝试将模型文件夹嵌套到一个新文件夹中,并将新文件夹导入模型注册表。两者都导致了上传错误,因为它们没有直接包含saved_pb文件。
任何建议都将非常感谢。谢谢你!
我最终通过从tensorflow导入模型并使用save函数将其保存在本地(而不是从tensorflow hub站点下载)来解决这个问题
import tensorflow as tf
import tensorflow_hub as hub
def get_model():
model_url = "https://tfhub.dev/tensorflow/efficientnet/lite0/feature-vector/2"
IMAGE_SHAPE = (370, 240)
layer = hub.KerasLayer(model_url, input_shape=IMAGE_SHAPE+(3,))
model = tf.keras.Sequential([layer])
return model
model = get_model()
# this is the important line
model.save("featureVectorModel")