Skip to content

Commit 0ee443a

Browse files
authored
Merge pull request #120
fix bug of import collections
2 parents d494417 + 2f9db81 commit 0ee443a

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

plsc/models/face_vit.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# https://github.com/deepinsight/insightface/blob/master/recognition/arcface_torch/backbones/vit.py
1717

1818
from collections.abc import Callable
19+
import collections
1920

2021
import os
2122
import math
@@ -457,18 +458,6 @@ def forward(self, inputs):
457458

458459
return {'logits': y, 'targets': targets}
459460

460-
def load_pretrained(self, path, rank=0, finetune=False):
461-
if not os.path.exists(path + '.pdparams'):
462-
raise ValueError("Model pretrain path {} does not "
463-
"exists.".format(path))
464-
465-
state_dict = self.state_dict()
466-
param_state_dict = paddle.load(path + ".pdparams")
467-
if not finetune:
468-
self.set_dict(param_state_dict)
469-
return
470-
return
471-
472461
def load_pretrained(self, path, rank=0, finetune=False):
473462
if not os.path.exists(path + '.pdparams'):
474463
raise ValueError("Model pretrain path {} does not "

0 commit comments

Comments
 (0)