Jung-Jun-Uk / UNPG

Unified Negative Pair Generation toward Well-discriminative Feature Space for Face Recognition
Apache License 2.0
29 stars 7 forks source link

ZeroDivisionError: float division by zero #7

Closed WakingHours-GitHub closed 10 months ago

WakingHours-GitHub commented 1 year ago
cosine_progress = cosine_iter / self.total_cosine_iters

ZeroDivisionError: float division by zero

when i run train.sh script. this error occur. ny train.sh as follow:

python train.py \
    --model 'iresnet-50' --head 'cosface' \
    --aux 'unpg' --data 'data/webface.yaml' \
    --max_epoch 30 \
    --hyp 'data/hyp.yaml' --name 'example' --device 6,7

please any soluation can fix this problem, i try add eps in devision, but something is error, i can't train...

Jung-Jun-Uk commented 1 year ago

I think the problem is that self.total_cosine_iters is 0.

Can you show me the each args in "scheduler = CosineWarmupLr(optimizer, batches_per_epoch, opt.max_epoch, base_lr=hyp['lr'], warmup_epochs=hyp['warmup_epochs']) "

each eargs: batches_per_epoch, opt.max_epoch, hyp['lr'], and hyp['warmup_epochs']

please check the batches_per_epoch size