Hi everyone,
I am trying to deploy a YOLO custom container model on Vertex AI using containerization. I have successfully:
✅ Built and tested the Docker image locally.
✅ Verified that the API (FastAPI + YOLO) runs correctly in the container.
✅ Successfully deployed and tested the same image on Cloud Run.
However, when deploying on Vertex AI as a custom container model, I am facing issues.
- name: Upload Mobile Model
run: |
EXISTING_MODEL=$(gcloud ai models list --region=$REGION --filter="displayName=freshpet-mobile" --format="value(name)" --limit=1)
if [ -z "$EXISTING_MODEL" ]; then
gcloud ai models upload --region=$REGION --display-name=freshpet-mobile --container-image-uri=$IMAGE_NAME_MOBILE
else
echo "Mobile model already exists, skipping upload."
fi
- name: Wait for Mobile Model to be Registered
run: |
timeout=$TIMEOUT_SECONDS
start_time=$(date +%s)
while true; do
MODEL_MOBILE_NAME=$(gcloud ai models list --region=$REGION --filter="displayName=freshpet-mobile" --format="value(name)" --limit=1)
if [ -n "$MODEL_MOBILE_NAME" ]; then
echo "Model Registered: $MODEL_MOBILE_NAME"
echo "MODEL_MOBILE_NAME=$MODEL_MOBILE_NAME" >> $GITHUB_ENV
break
fi
if [ $(( $(date +%s) - start_time )) -gt $timeout ]; then
echo "Timeout waiting for model registration." && exit 1
fi
sleep 10
done
- name: Deploy Mobile Model to Endpoint
run: |
ENDPOINT_MOBILE_ID=$(gcloud ai endpoints list --region=$REGION --filter="displayName=freshpet-mobile-endpoint" --format="value(name)" --limit=1)
if [ -z "$ENDPOINT_MOBILE_ID" ]; then
ENDPOINT_MOBILE_ID=$(gcloud ai endpoints create --region=$REGION --display-name=freshpet-mobile-endpoint --format="value(name)")
fi
gcloud ai endpoints deploy-model $ENDPOINT_MOBILE_ID \
--region=$REGION \
--model=$MODEL_MOBILE_NAME \
--display-name=mobile-container-deploy \
--machine-type=$MACHINE_TYPE \
--accelerator=count=1,type=$GPU_TYPE \
--min-replica-count=$MIN_REPLICAS \
--enable-access-logging \
--autoscaling-metric-specs=$AUTOSCALING_METRIC
Any help would be greatly appreciated! Thanks in advance. 🙏
error mail
Hello Vertex AI Customer,
Due to an error, Vertex AI was unable to deploy model "freshpet-mobile@1".
Additional Details:
Operation State: Failed with errors
Resource Name:
projects/1061052074258/locations/us-central1/models/5571072585824731136
Error Messages: Model server never became ready. Please validate that your
model file or container configuration are valid. Model server logs can be
found at
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |