deepinsight / deepinsight/insightface

Fine-tune Pytorch ArcFace pre-trained model on custom data

Open
#2,215 4 comments 3 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

Hi guys,

I want to fine-tune the Arcface model on my custom dataset. I am facing some errors. The details are shared below:

**Arcface Pytorch Repo:** https://github.com/deepinsight/insightface/tree/master/recognition/arcface_torch
**Pre-trained Model (model to fine-tune):** [ms1mv3_arcface_r50_fp16](https://onedrive.live.com/?authkey=%21AFZjr283nwZHqbA&id=4A83B6B633B029CC%215583&cid=4A83B6B633B029CC) `file:` rank_0_softmax_weight.pt

**Model Config:**
I set the *` config.resume `* flag to true (to load the pre-trained model for training)
`config.resume = True`

**Command I used to train the model:**
`python -m torch.distributed.launch --nproc_per_node=1 --nnodes=1 --node_rank=0 --master_addr="127.0.0.1" --master_port=12581 train.py configs/ms1mv3_r50`

When I run the above command I get an error:

```
Traceback (most recent call last):
File "train.py", line 306, in
main(parser.parse_args())
File "train.py", line 176, in the main
start_epoch = dict_checkpoint["epoch"]
IndexError: too many indices for the tensor of dimension
```

Please guide me on how I can fine-tune the model using faceinsight.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.