From 34b23fdca30d55224822f2850610761b5509cbba Mon Sep 17 00:00:00 2001 From: Yonghye Kwon Date: Sat, 22 Jun 2024 20:29:14 +0900 Subject: [PATCH] set pos interpolate mode to bilinear to support mps device --- depth_anything_v2/dinov2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depth_anything_v2/dinov2.py b/depth_anything_v2/dinov2.py index 83d25081..494f53f8 100644 --- a/depth_anything_v2/dinov2.py +++ b/depth_anything_v2/dinov2.py @@ -200,7 +200,7 @@ def interpolate_pos_encoding(self, x, w, h): patch_pos_embed.reshape(1, int(sqrt_N), int(sqrt_N), dim).permute(0, 3, 1, 2), scale_factor=(sx, sy), # (int(w0), int(h0)), # to solve the upsampling shape issue - mode="bicubic", + mode="bicubic" if x.device.type != "mps" else "bilinear", antialias=self.interpolate_antialias )