ZhengPeng7 commited on
Commit
e2bf8e4
·
1 Parent(s): 273735e

Fix the no attribute 'all_tied_weights_keys' issue in transformers==5.0.0.

Browse files
Files changed (1) hide show
  1. birefnet.py +2 -0
birefnet.py CHANGED
@@ -2036,6 +2036,8 @@ class BiRefNet(
2036
  if 'bb.' in key and 'refiner.' not in key:
2037
  value.requires_grad = False
2038
 
 
 
2039
  def forward_enc(self, x):
2040
  if self.config.bb in ['vgg16', 'vgg16bn', 'resnet50']:
2041
  x1 = self.bb.conv1(x); x2 = self.bb.conv2(x1); x3 = self.bb.conv3(x2); x4 = self.bb.conv4(x3)
 
2036
  if 'bb.' in key and 'refiner.' not in key:
2037
  value.requires_grad = False
2038
 
2039
+ self.post_init()
2040
+
2041
  def forward_enc(self, x):
2042
  if self.config.bb in ['vgg16', 'vgg16bn', 'resnet50']:
2043
  x1 = self.bb.conv1(x); x2 = self.bb.conv2(x1); x3 = self.bb.conv3(x2); x4 = self.bb.conv4(x3)