DepthAnything / Depth-Anything-V2

[NeurIPS 2024] Depth Anything V2. A More Capable Foundation Model for Monocular Depth Estimation
https://depth-anything-v2.github.io
Apache License 2.0
3.81k stars 324 forks source link

"xFormers not available" error when running the sample code #125

Open 1412-KID opened 3 months ago

1412-KID commented 3 months ago

import cv2 import torch

from depth_anything_v2.dpt import DepthAnythingV2

get error! /usr/bin/python3 /home/dp/Depth-Anything-V2/test.py xFormers not available xFormers not available

1412-KID commented 3 months ago

企业微信截图_20240808104033 I don't know how to solve this problem.

LiheYoung commented 3 months ago

Indeed, this warning will not affect the running of the sample code. You can also install the xformers library to avoid this warning.

Master-cai commented 2 months ago

Hi @LiheYoung !, I'm wondering what's the difference w/wo xformers? Speed or what else?

heyoeyo commented 2 months ago

I'm wondering what's the difference w/wo xformers?

It can help a lot if you run at higher input image sizes, but only works with cuda. Memory usage drops significantly and if you use float16, there's a significant speed up as well. Here's a results comparison for depth-anything v1 (should be the same for v2).