Spaces:
Running
on
T4
Running
on
T4
Removed print statements
Browse files
models/GroundingDINO/ms_deform_attn.py
CHANGED
|
@@ -52,7 +52,6 @@ class MultiScaleDeformableAttnFunction(Function):
|
|
| 52 |
im2col_step,
|
| 53 |
):
|
| 54 |
ctx.im2col_step = im2col_step
|
| 55 |
-
print("getting forward output")
|
| 56 |
output = _C.ms_deform_attn_forward(
|
| 57 |
value,
|
| 58 |
value_spatial_shapes,
|
|
@@ -61,7 +60,6 @@ class MultiScaleDeformableAttnFunction(Function):
|
|
| 61 |
attention_weights,
|
| 62 |
ctx.im2col_step,
|
| 63 |
)
|
| 64 |
-
print("got msdeform forward output")
|
| 65 |
ctx.save_for_backward(
|
| 66 |
value,
|
| 67 |
value_spatial_shapes,
|
|
@@ -224,12 +222,10 @@ class MultiScaleDeformableAttention(nn.Module):
|
|
| 224 |
constant_(self.output_proj.bias.data, 0.0)
|
| 225 |
|
| 226 |
def freeze_sampling_offsets(self):
|
| 227 |
-
print("Freeze sampling offsets")
|
| 228 |
self.sampling_offsets.weight.requires_grad = False
|
| 229 |
self.sampling_offsets.bias.requires_grad = False
|
| 230 |
|
| 231 |
def freeze_attention_weights(self):
|
| 232 |
-
print("Freeze attention weights")
|
| 233 |
self.attention_weights.weight.requires_grad = False
|
| 234 |
self.attention_weights.bias.requires_grad = False
|
| 235 |
|
|
|
|
| 52 |
im2col_step,
|
| 53 |
):
|
| 54 |
ctx.im2col_step = im2col_step
|
|
|
|
| 55 |
output = _C.ms_deform_attn_forward(
|
| 56 |
value,
|
| 57 |
value_spatial_shapes,
|
|
|
|
| 60 |
attention_weights,
|
| 61 |
ctx.im2col_step,
|
| 62 |
)
|
|
|
|
| 63 |
ctx.save_for_backward(
|
| 64 |
value,
|
| 65 |
value_spatial_shapes,
|
|
|
|
| 222 |
constant_(self.output_proj.bias.data, 0.0)
|
| 223 |
|
| 224 |
def freeze_sampling_offsets(self):
|
|
|
|
| 225 |
self.sampling_offsets.weight.requires_grad = False
|
| 226 |
self.sampling_offsets.bias.requires_grad = False
|
| 227 |
|
| 228 |
def freeze_attention_weights(self):
|
|
|
|
| 229 |
self.attention_weights.weight.requires_grad = False
|
| 230 |
self.attention_weights.bias.requires_grad = False
|
| 231 |
|