depth anything复现时遇到的问题

问题一:depth_anything = DepthAnything.from_pretrained('LiheYoung/depth_anything_{}14'.format(args.encoder)).to(DEVICE).eval()

加载.pth文件时出问题了?

错误提示:huggingface_hub.utils._errors. LocalEntryNotFoundError: an error happened while trying to locate the file on the HU and we cannot find the requested files in the local cache.

解决方案:

下载权重,使用国内的镜像,首先在命令行执行下面的命令设置下环境变量:

export HF_ENDPOINT=https://hf-mirror.com

然后再运行run.sh

问题解决 √

问题二:depth = depth_anything(image)

加载图片时出问题了,与权重文件不匹配吗?

错误提示:RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same

解决方案:将所有的内容都放到cpu上运行,即DEVICE = torch.device("cpu")

问题解决 √

问题三:depth = depth_anything(image)

是torch版本问题吗?

错误提示:TypeError: interpolate() got an unexpected keyword argument 'antialias'

解决方案:在run.sh文件中加入更新torch和torchvision的命令

问题解决 √

附加:run.sh 是我自己写的,可参考

pip install -r requirements.txt
pip install --upgrade torch
pip install --upgrade torchvision
python run.py --encoder vits --img-path assets/examples

  • 14
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值