安装backgroundremover成功,但是调用接口得时候,报错。 开始以为是少了什么包。后来检查是因为国外镜像太卡没用下载到 模型。backgroundremover 应用报错AttributeError: module 'torch.backends' has no attribute 'mps'
解决问题经过几步
1,设置阿里镜像
pip config set global.index-url
https://mirrors.aliyun.com/pypi/simple/
2,卸载重装backgroundremover包
3,手动下载模型
我找到的用 百度网盘得资源包
https://pan.baidu.com/share/init?surl=WjwyEwDiaUjBbx_QxcXBwQ
码:pf9k
下载文件后,放到用户的home目录下的.u2net目录下
我的是windows10, C:\Users\用户\.u2net
重启cmd命令窗口,输入接口命令。 就可以调用了。