开发者社区 > ModelScope模型即服务 > 计算机视觉 > 正文

ModelScope中,启动报错了是什么原因?

ModelScope中,启动报错了root@dsw-135963-5b97849f64-jdwjd:/mnt/workspace/facechain# python3 app.py
2023-11-01 17:42:30,609 - modelscope - INFO - PyTorch version 2.0.1+cu118 Found.
2023-11-01 17:42:30,613 - modelscope - INFO - TensorFlow version 2.13.0 Found.
2023-11-01 17:42:30,613 - modelscope - INFO - Loading ast index from /mnt/workspace/.cache/modelscope/ast_indexer
2023-11-01 17:42:30,613 - modelscope - INFO - No valid ast index found from /mnt/workspace/.cache/modelscope/ast_indexer, generating ast index from prebuilt!
2023-11-01 17:42:30,775 - modelscope - INFO - Loading done! Current index file version is 1.9.4, with md5 9c8fe3d94961b6d5d2f8b653ad63c2ea and a total number of 945 components indexed
/opt/conda/lib/python3.8/site-packages/controlnet_aux/mediapipe_face/mediapipe_face_common.py:7: UserWarning: The module 'mediapipe' is not installed. The package will have limited functionality. Please install it using the command: pip install 'mediapipe'
warnings.warn(
2023-11-01 17:42:32.396846: I tensorflow/core/util/port.cc:110] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable TF_ENABLE_ONEDNN_OPTS=0.
2023-11-01 17:42:32.438061: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-11-01 17:42:33.151005: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Traceback (most recent call last):
File "app.py", line 1414, in
train_input()
File "app.py", line 980, in train_input
with gr.Box():
AttributeError: module 'gradio' has no attribute 'Box'lQLPJxh0zyr3KpDNAtbNCKSwR3VowDrweH8FNC9tumXoAA_2212_726.png

展开
收起
多麻辣哦 2023-11-08 20:47:41 583 0
4 条回答
写回答
取消 提交回答
  • 解决了吗?我也遇到同样的问题了。
    gradio 有安装,执行 python3 app.py 也是提示 AttributeError: module 'gradio' has no attribute 'Box'

    查看app.py 也引入了 import gradio as gr

    2023-12-20 14:45:52
    赞同 展开评论 打赏
  • 面对过去,不要迷离;面对未来,不必彷徨;活在今天,你只要把自己完全展示给别人看。

    您似乎遇到了一个问题,即缺少名为 'gradio' 的模块,这可能导致在运行脚本时出现错误 "AttributeError: module 'gradio' has no attribute 'Box'"。要解决这个问题,您需要安装 'gradio' 模块。
    可以通过以下命令安装它:

    pip install gradio
    
    2023-11-09 14:06:09
    赞同 展开评论 打赏
  • 这个错误是因为在运行app.py时,找不到名为'gradio'的模块。请确保已经正确安装了gradio库,可以使用以下命令进行安装:

    pip install gradio
    

    如果已经安装了gradio库,但仍然出现此错误,请检查是否正确导入了gradio库。在app.py文件的开头添加以下代码:

    import gradio as gr
    
    2023-11-09 10:45:39
    赞同 展开评论 打赏
  • gradio3.47.1——此回答整理自钉群:魔搭ModelScope开发者联盟群 ①

    2023-11-08 21:50:31
    赞同 1 展开评论 打赏

包含图像分类、图像生成、人体人脸识别、动作识别、目标分割、视频生成、卡通画、视觉评价、三维视觉等多个领域

相关电子书

更多
视觉AI能力的开放现状及ModelScope实战 立即下载
ModelScope助力语音AI模型创新与应用 立即下载
低代码开发师(初级)实战教程 立即下载