401 Deadline exception when using Imagen Python
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với đoạn mã Python Imagen được cung cấp và nhật ký lỗi Cloud Run cho thấy lỗi 401 Deadline. Kiểm tra xem lỗi có thể được tái hiện xung quanh model.generate_images hay không và xác định hành vi yêu cầu liên quan của Vertex AI; issue được hoàn tất khi nguyên nhân và một cách giải quyết đã được xác minh được ghi lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Example code:
vertexai.init(project=PROJECT_ID, location=LOCATION)
model: ImageGenerationModel = ImageGenerationModel.from_pretrained(model_name=MODEL_NAME)
Common.log_info(message='Handling image generation request')
Common.log_https_request(req=req)
data: dict = req.data
prompt: str = data.get(PROMPT_KEY, '')
user_id: str = req.auth.uid
if not user_id:
Common.log_info(message='Invalid user id, not generating image')
return
if not prompt:
Common.log_info(message='Invalid prompt, not generating image')
return
number_of_images: int = data.get(NUMBER_OF_IMAGES_KEY, 1)
guidance_scale: int = data.get(GUIDANCE_SCALE_KEY, MEDIUM_GUIDANCE_SCALE)
output_image_path: str = (GENERATED_IMAGE_PREFIX + user_id +
'/' +
Common.get_current_datetime() + '/' +
Common.replace_all_whitespace_with_underscore(
input_string=prompt) + JPEG_SUFFIX)
output_gcs_uri: str = BUCKET_URI_PREFIX + output_image_path
Common.log_info(message=f'Generating image at: {output_gcs_uri}')
model.generate_images(
prompt=prompt,
number_of_images=number_of_images,
aspect_ratio=Common.convert_to_aspect_ratio(input_string=data.get(ASPECT_RATIO_KEY, '')),
output_gcs_uri=BUCKET_URI_PREFIX + output_image_path,
language=AUTO_LANGUAGE_DETECTION,
guidance_scale=guidance_scale,
add_watermark=False,
safety_filter_level=STRICT_SAFETY_FILTER,
person_generation=ALLOW_ADULT_PERSON_GENERATION,
)
Common.log_info(message=f'Generated image at: {output_image_path}')
return {
GENERATED_IMAGE_PATH_KEY: output_image_path
}
Log output
{
insertId: "668e115800009112eb018410"
labels: {
execution_id: "RCyLEQaZkqtT"
goog-managed-by: "cloudfunctions"
instanceId: "0087244a805cf6d58e414f53f12334887c32a9193fd30e864537965aed11aef51420d9a28124761e498af43bce228ec8099599bc142b0e59e58e9ea6dac43d80"
}
logName: "projects/claptrap-project/logs/run.googleapis.com%2Fstderr"
receiveTimestamp: "2024-07-10T04:43:04.043022212Z"
resource: {
labels: {
configuration_name: "generate-images"
location: "us-central1"
project_id: "claptrap-project"
revision_name: "generate-images-00004-mil"
service_name: "generate-images"
}
type: "cloud_run_revision"
}
severity: "ERROR"
spanId: "10602671325904409459"
textPayload: "An exception occurred: 401 Image generation failed with the following error: Deadline"
timestamp: "2024-07-10T04:43:04.037138Z"
}
- Ngôn ngữ chính
- Jupyter Notebook
- Star
- 8.1k
- Fork
- 6.7k
- Merge trung bình
- 4 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của GoogleCloudPlatform/python-docs-samples
-
samples
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
GoogleCloudPlatform/python-docs-samples#14609 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
samples
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
GoogleCloudPlatform/python-docs-samples#14610 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
samples
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
GoogleCloudPlatform/python-docs-samples#14611 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
chore(generative_ai) Update model references for generative_ai samplesCó thể làm lại được @XrossFox đã nhận 151 ngày trước và không có pull request nào đang mở. Đang mởsamples
GoogleCloudPlatform/python-docs-samples#14117 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix Pipeline dependency issues for geospatial-classification/serving_appCó thể làm lại được @XrossFox đã nhận 163 ngày trước và không có pull request nào đang mở. Đang mởsamples
GoogleCloudPlatform/python-docs-samples#14091 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của GoogleCloudPlatform/python-docs-samples
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
open-webui/open-webui#31432 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
apache/texera#8682 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ai-for-developers/awesome-ai-coding-tools#774 ·
Maintainer thường phản hồi trong vòng 7 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
run-llama/llama_index#23243 ·
Maintainer thường phản hồi trong vòng 2 ngày