bubbliiiing / arcface-pytorch

这是一个arcface-pytorch的源码,可以用于训练自己的模型。
MIT License
131 stars 23 forks source link

为什么加载预训练权值失败 #39

Open lllittleX opened 1 month ago

lllittleX commented 1 month ago

Load weights model_data/mobilenet_v1_backbone_weights.pth.

Successful Load Key: [] …… Successful Load Key Num: 0

Fail To Load Key: ['stage1.0.0.weight', 'stage1.0.1.weight', 'stage1.0.1.bias', 'stage1.0.1.running_mean', 'stage1.0.1.running_var', 'stage1.0.1.num_batches_tracked', 'stage1.1.0.weight', 'stage1.1.1.weight', 'stage1.1.1.bias', 'stage1.1.1.running_mean', 'stage1.1.1.running_var', 'stage1.1.1.num_batches_tracked', 'stage1.1.3.weight', 'stage1.1.4.weight', 'stage1.1.4.bias', 'stage1.1.4.running_mean', 'stage1.1.4.running_var', 'stage1.1.4.num_batches_tracked', 'stage1.2.0.weight', 'stage1.2.1.weight', 'stage1.2.1.b …… Fail To Load Key num: 164

温馨提示,head部分没有载入是正常现象,Backbone部分没有载入是错误的。 D:\code\RecognizeFace\ArcFace_Bubble\utils\dataloader.py:62: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. return np.array(pairs) Epoch 1/1500: 0%| | 0/14291 [00:00<?, ?it/s<class 'dict'>]Configurations: | keys | values| | num_classes | 11090| | backbone | mobilenetv1| | model_path | model_data/mobilenet_v1_backbone_weights.pth| | input_shape | [112, 112, 3]| | Init_Epoch | 0| | Epoch | 1500| | batch_size | 32| | Init_lr | 0.01| | Min_lr | 0.0001| | optimizer_type | sgd| | momentum | 0.9| | lr_decay_type | cos| | save_period | 20| | save_dir | logs| | num_workers | 4| | num_train | 457340| | num_val | 4619|

使用mobilenet模型,但是加载了作者给的model_data/mobilenet_v1_backbone_weights.pth.为什么提示加载失败