Open AnujPanthri opened 1 year ago
It could be rather hard reaching any satisfactory result using mobilenet +casia only, even not possible... I'm previously using RTX8000 with 46GB GPU memory. Regarding your script, may try:
lr_decay_steps=16
, will using a cosine learning rate with restart, and lr will will be restarted on epoch [16+1==17, 17 + 16 * 2 + 1 == 50]
with value [lr_base / 2 == 5e-4, lr_base / 4 == 2.5e-4]
. So it's better set total epochs 17 or 50.TF>=2.12.0
, may add some weight_decay to keras.optimizer.Adam
.ArcfaceLoss
scale
till 64.
data_path = "faces_webface_112x112_112x112_folders"
eval_paths = ["faces_webface_112x112/lfw.bin"]
basic_model = models.buildin_models("MobileNet", dropout=0, emb_shape=256, output_layer="E")
tt = train.Train(data_path, save_path='mobilenet_256_adam_E.h5', eval_paths=eval_paths, basic_model=basic_model, batch_size=512, random_status=0, lr_base=0.001, lr_decay=0.5, lr_decay_steps=16, lr_min=1e-5)
optimizer = keras.optimizers.Adam(learning_rate=0.001, weight_decay=5e-4) sch = [ {"loss": losses.ArcfaceLoss(scale=16), "epoch": 10, "optimizer": optimizer}, {"loss": losses.ArcfaceLoss(scale=32), "epoch": 10}, {"loss": losses.ArcfaceLoss(scale=64), "epoch": 30}, ] tt.train(sch, 0)
First of all this repo is really helpful for me and it has helped me a lot , so thank you for this and more over thank you for replying to me .
Wow 46 gb vram is impressive probably that is why you were able to use large batch sizes.
and I feel the main bottleneck is using casia dataset in my case , as you have got better results with mobilenet when trained on MS1M dataset.
I was trying to train a mobilenet model using arcloss on casia dataset and I am unable to exceed lfw acc more than ~0.9763.
I wanna know is this the best accuracy I can get using this dataset(casia) ? as training on ms1m is not possible for me as it is really large.
Also as I was checking your training scripts I saw that you are using large batch size and you have done a lot of experiments, didn't those took a lot of this ? what hardware did you used to train them?
I am mainly using google colab and kaggle for training .
training code :
training logs: