File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change 16
16
# https://github.com/deepinsight/insightface/blob/master/recognition/arcface_torch/backbones/vit.py
17
17
18
18
from collections .abc import Callable
19
+ import collections
19
20
20
21
import os
21
22
import math
@@ -457,18 +458,6 @@ def forward(self, inputs):
457
458
458
459
return {'logits' : y , 'targets' : targets }
459
460
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
-
472
461
def load_pretrained (self , path , rank = 0 , finetune = False ):
473
462
if not os .path .exists (path + '.pdparams' ):
474
463
raise ValueError ("Model pretrain path {} does not "
You can’t perform that action at this time.
0 commit comments