Open molyswu opened 5 years ago
Have you aligned your test set?
python align_lfw.py --input-dir data/lfw --output-dir out_data1
--image_size 112,112
Traceback (most recent call last):
File "train.py", line 542, in
解决了么兄弟,求指教?
The problem is from the get_dataset_common function in face_image.py which is used when alligning your dataset. It only returns a list of paths to images if there is more then 10 images in that folder. And a lot of folders has less resulting in a smaller alligned data set. Because of this nearly all pairs that are not a match is invalidated as you lfw_alligned will no longer contain those images.
To fix this change this line: if len(os.listdir(os.path.join(input_dir, person_name)))>10: to -> if len(os.listdir(os.path.join(input_dir, person_name)))>0:
And change the following in the calculate_val_far in the facenet.py from: val = float(true_accept) / float(n_same) from: far = float(false_accept) / float(n_diff) to: val = float(true_accept) / float(n_same) if n_same != 0 else 0 to: far = float(false_accept) / float(n_diff) if n_diff != 0 else 0
Additive-Margin-Softmax ,train lfw as following eorror: $python train.py --data_dir out_data1 --random_flip --learning_rate -1 --learning_rate_schedule_file ./data/learning_rate_AM_softmax.txt --lfw_dir data/lfw --keep_probability 0.8 --weight_decay 5e-4