401 Deadline exception when using Imagen Python
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
从提供的 Imagen Python 代码片段和显示 401 Deadline 失败的 Cloud Run 错误日志开始。检查是否可以在 model.generate_images 附近复现该失败,并确定相关的 Vertex AI 请求行为;当原因和经过验证的解决方案都记录完毕后,该 issue 即完成。
由索引模型根据 Issue 内容生成。
描述
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"
}
- 主要语言
- Jupyter Notebook
- 星标
- 8.1k
- 派生
- 6.7k
- 平均合并
- 4 天 4 小时
- 30 天内合并 PR
- 8
环境准备
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GoogleCloudPlatform/python-docs-samples 的其他 Issue
-
samples
难度 2/5 1-3 小时 新手友好度 88/100
GoogleCloudPlatform/python-docs-samples#14609 ·
维护者通常 1 天内回复
-
samples
难度 1/5 1 小时以内 新手友好度 92/100
GoogleCloudPlatform/python-docs-samples#14610 ·
维护者通常 1 天内回复
-
samples
难度 2/5 1-3 小时 新手友好度 88/100
GoogleCloudPlatform/python-docs-samples#14611 ·
维护者通常 1 天内回复
-
chore(generative_ai) Update model references for generative_ai samples可能重新可做 @XrossFox 于 152 天前认领,目前没有进行中的 PR。 未关闭samples
GoogleCloudPlatform/python-docs-samples#14117 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Fix Pipeline dependency issues for geospatial-classification/serving_app可能重新可做 @XrossFox 于 164 天前认领,目前没有进行中的 PR。 未关闭samples
GoogleCloudPlatform/python-docs-samples#14091 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 GoogleCloudPlatform/python-docs-samples 的全部 Issue
相似的 Issue
-
Docs never explain image replay cost with native-vision models or the tools.media.models[] opt-out未关闭clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr impact:ux-friction issue-rating: 🌊 off-meta tidepool P2
难度 2/5 1-3 小时 新手友好度 88/100
openclaw/openclaw#159202 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
comp/tools P2 tool/delegate type/bug
难度 2/5 1-3 小时 新手友好度 78/100
NousResearch/hermes-agent#124460 ·
维护者通常 1 天内回复
-
Amazon as Lab ?未关闭
难度 2/5 1-3 小时 新手友好度 68/100
anomalyco/models.dev#8163 · 1 条评论 ·
维护者通常 1 天内回复
-
python triage
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/semantic-kernel#14490 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复