1. fix warnings. \n 2. support CPU mode. \n 3. update README.

This commit is contained in:
SlongLiu
2023-03-27 12:12:49 +08:00
parent 2309f9f468
commit 858efccbad
6 changed files with 45 additions and 22 deletions

View File

@@ -25,7 +25,10 @@ from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.init import constant_, xavier_uniform_
from groundingdino import _C
try:
from groundingdino import _C
except:
warnings.warn("Failed to load custom C++ ops. Running on CPU mode Only!")
# helpers
@@ -323,6 +326,7 @@ class MultiScaleDeformableAttention(nn.Module):
reference_points.shape[-1]
)
)
if torch.cuda.is_available() and value.is_cuda:
halffloat = False
if value.dtype == torch.float16: