luckycallor / InsightFace-tensorflow

Tensoflow implementation of InsightFace (ArcFace: Additive Angular Margin Loss for Deep Face Recognition).
248 stars 112 forks source link

finetune loss always big #14

Open x3393467 opened 5 years ago

x3393467 commented 5 years ago

I finetune the model with my datasets, but the loss is always big
Epoch: [ 0/ 1] [ 15030/500000] time: 0.25, loss: 29.442 (inference: 27.447, wd: 1.994), acc: 0.000 Epoch: [ 0/ 1] [ 15031/500000] time: 0.25, loss: 12.441 (inference: 10.447, wd: 1.994), acc: 0.167 Epoch: [ 0/ 1] [ 15032/500000] time: 0.26, loss: 20.296 (inference: 18.302, wd: 1.994), acc: 0.167

and this is my confit_finetune.yaml:


model params

backbone_type: resnet_v2_m_50 loss_type: arcface out_type: E

image_size: 112 embd_size: 512 class_num: 93979

hyper params

bn_decay: 0.9 keep_prob: 0.4 weight_decay: !!float 5e-4 logits_scale: 64.0 logits_margin: 0.5 momentum: 0.9

run params

fixed_epoch_num: 1 val_bn_train: False augment_flag: True augment_margin: 16

gpu_num: 1 batch_size: 6 epoch_num: 1 step_per_epoch: 500000 val_freq: 100000

lr_steps: [40000, 60000, 80000] lr_values: [0.004, 0.002, 0.0012, 0.0004]

paths

pretrained_model: 'E:/weight/insight_face/best-m-334000' train_data: ['F:/data_sets/tfrecord/faces_glintasia_cls93979.tfrecord'] val_data: {'lfw': 'E:/data_sets/val_data/lfw.bin'} output_dir: 'output/'


what can I do in this situation? please

luckycallor commented 5 years ago

@x3393467 the finetune code only update the last fully connected layer within the "fixed_epoch_num". I recommend you change the run params.

CNruxiangduan commented 5 years ago

@luckycallor hi, I also have this problem, and tried to change some params, but don't work, can you give some advices detail? thanks