①IMPORTANT: You are using gradio version 3.49.0, however version 4.29.0 is available, please upgrade
原因分析:
因为使用的gradio版本过高,使用较低版本。
pip install gradio==3.49.0
会有提示IMPORTANT: You are using gradio version 3.49.0, however version 4.29.0 is available, please upgrade.:
Running on local URL: http://127.0.0.1:7862
To create a public link, set `share=True` in `launch()`.
IMPORTANT: You are using gradio version 3.49.0, however version 4.29.0 is available, please upgrade.
此时将在公网访问的功能打开
在源码目录中修改web_demo.py的最后一行,将share=False修改为share=True:
demo.queue().launch(share=True, inbrowser=True)
②AttributeError: 'Textbox' object has no attribute 'style'. Did you mean: 'scale'
原因分析:
gradio高版本舍弃了部分方法
AttributeError: 'Textbox' object has no attribute 'style'. Did you mean: 'scale'?
此时需要修改源码中的
修改成以下格式,就能在内网、公网上正常访问:
user_input = gr.Textbox(show_label=False, placeholder="Input...", lines=10,
container=False)
解决以上问题,就能成功访问:
③NotImplementedError: Using RTX 4000 series doesn't support faster communication broadband via P2P or IB. Please set `NCCL_P2P_DISABLE="1"` and `NCCL_IB_DISABLE="1" or use `accelerate launch` which will do this automatically.
解决方法:
在命令行中输入:
export NCCL_IB_DISABLE="1"
export NCCL_P2P_DISABLE="1"
以上代码用于一次性设置,重启或者切换环境需要重新设置
没有添加至环境变量的原因是防止污染服务器环境,造成其他用户的错误难以分析。
④出现ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device
解决方案:
修改缓存目录
export TMPDIR=/data/自己的目录