fix latest `PretrainedModel` compat

#1
by kavorite - opened
florence2_implementation/modeling_florence2.py CHANGED
@@ -632,6 +632,10 @@ class DaViT(nn.Module):
632
  elif isinstance(m, nn.BatchNorm2d):
633
  nn.init.constant_(m.weight, 1.0)
634
  nn.init.constant_(m.bias, 0)
 
 
 
 
635
 
636
  def forward_features_unpool(self, x):
637
  """
 
632
  elif isinstance(m, nn.BatchNorm2d):
633
  nn.init.constant_(m.weight, 1.0)
634
  nn.init.constant_(m.bias, 0)
635
+
636
+ def _initialize_weights(self, m):
637
+ """For compatibility with PretrainedModel"""
638
+ self._init_weights(m)
639
 
640
  def forward_features_unpool(self, x):
641
  """