Commit
·
ecdeb62
1
Parent(s):
0bce61e
Fix the no attribute 'all_tied_weights_keys' issue in transformers==5.0.0.
Browse files- birefnet.py +2 -0
birefnet.py
CHANGED
|
@@ -2038,6 +2038,8 @@ class BiRefNet(
|
|
| 2038 |
if 'bb.' in key and 'refiner.' not in key:
|
| 2039 |
value.requires_grad = False
|
| 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)
|
|
|
|
| 2038 |
if 'bb.' in key and 'refiner.' not in key:
|
| 2039 |
value.requires_grad = False
|
| 2040 |
|
| 2041 |
+
self.post_init()
|
| 2042 |
+
|
| 2043 |
def forward_enc(self, x):
|
| 2044 |
if self.config.bb in ['vgg16', 'vgg16bn', 'resnet50']:
|
| 2045 |
x1 = self.bb.conv1(x); x2 = self.bb.conv2(x1); x3 = self.bb.conv3(x2); x4 = self.bb.conv4(x3)
|