yule-li / CosFace

Tensorflow implementation for paper CosFace: Large Margin Cosine Loss for Deep Face Recognition
285 stars 99 forks source link

Could you tell me how to solve the error: too few arguments? #12

Open deardream000 opened 5 years ago

deardream000 commented 5 years ago

$ python test.py usage: test.py [-h] [--network_type NETWORK_TYPE] [--fc_bn] [--prewhiten] [--save_model SAVE_MODEL] [--do_flip DO_FLIP] [--lfw_batch_size LFW_BATCH_SIZE] [--embedding_size EMBEDDING_SIZE] [--image_size IMAGE_SIZE] [--image_height IMAGE_HEIGHT] [--image_width IMAGE_WIDTH] [--lfw_pairs LFW_PAIRS] [--lfw_file_ext {jpg,png}] [--lfw_nrof_folds LFW_NROF_FOLDS] [--model_def MODEL_DEF] lfw_dir model test.py: error: too few arguments

deardream000 commented 5 years ago

@yule-li

yule-li commented 5 years ago

Please run test.sh to get test accuracy. If you want to run python test.py, you can use the default arguments in test.sh.

deardream000 commented 5 years ago

Would you please tell me how to use the default arguments in test.sh? I can`t run test.sh. test.sh: 20: test.sh: Syntax error: end of file unexpected (expecting "then") Then what arguments do I need to change if I want to run python test.py?

yule-li commented 5 years ago

You can run command like this: CUDA_VISIBLE_DEVICES=1 python test/test.py dataset/lfw-112X96 models/model-20180309-083949.ckpt-60000 --lfw_file_ext jpg --network_type --embedding_size 512 --prewhiten --image_height 112 --image_width 96, and modify dataset/lfw-112X96 models/model-20180309-083949.ckpt-60000 to your saved model path if necessary.

deardream000 commented 5 years ago

When I run test.sh usage: test.py [-h] [--lfw_dir LFW_DIR] [--network_type NETWORK_TYPE] [--fc_bn] [--prewhiten] [--save_model SAVE_MODEL] [--do_flip DO_FLIP] [--lfw_batch_size LFW_BATCH_SIZE] [--embedding_size EMBEDDING_SIZE] [--model MODEL] [--image_size IMAGE_SIZE] [--image_height IMAGE_HEIGHT] [--image_width IMAGE_WIDTH] [--lfw_pairs LFW_PAIRS] [--lfw_file_ext {jpg,png}] [--lfw_nrof_folds LFW_NROF_FOLDS] [--model_def MODEL_DEF] test.py: error: unrecognized arguments: dataset/lfw-112X96 models/model-20180309-083949.ckpt-60000

wencoast commented 4 years ago

@deardream000 @yule-li For using model-20180309-083949.ckpt-60000 pre-trained model, my setting as follows. It works for me. YOUR_DATA_DIR YOUR_OWN_DIR/PretrainedModel/models/model-20180309-083949.ckpt-60000 --network_type sphere_network --prewhiten --do_flip True --lfw_file_ext jpg --embedding_size 512 --image_height 112 --image_width 96