我正在 Sagemaker Studio Lab 笔记本上尝试 Gradio 的简单示例。但输出没有出现。 根据在笔记本上运行时的文档,它应该出现在笔记本中。这确实是我在 Google CoLab 中运行示例时发生的情况。 Sagemaker Studio Lab 需要额外设置。
执行了demo.launch(),但什么也没出现。
虽然我不确定您使用的示例是否尝试过:
Use inline=False and server_port=6006.
gr.Interface(
fn=infer,
title="Monocular Depth Estimation",
description = "Keras Implementation of Unet architecture with Densenet201 backbone for estimating the depth of image 📏",
inputs=[gr.inputs.Image(label="image", type="numpy", shape=(640, 480))],
outputs="image",
article = "Author: <a href=\"https://huggingface.co/vumichien\">Vu Minh Chien</a>. Based on the Keras example from <a href=\"https://keras.io/examples/vision/depth_estimation/\">Victor Basu</a>. Repo: https://github.com/machinelearnear/use-gradio-streamlit-sagemaker-studiolab",
examples=examples).launch(inline=False, server_port=6006, debug=True, cache_examples=True)
https://github.com/machinelearnear/use-gradio-streamlit-sagemaker-studiolab