使用gradio进行上传图片时出现 另一个程序正在使用此文件,进程无法访问错误(ERROR: Exception in ASGI application)

今天做gradio部署遇到一个问题
从gradio官方文档copy的代码运行报错

import gradio as gr

def image_classifier(inp):
    return {
    
    'cat': 0.3, 'dog': 0.7}

demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
demo.launch()

报错信息
找了一大堆结果没成功,好像是window系统不兼容的问题
采取降级gradio方法

pip install gradio==3.50.2

猜你喜欢

转载自blog.csdn.net/Silver__Wolf/article/details/134198736