tjddus9597 / Proxy-Anchor-CVPR2020

Official PyTorch Implementation of Proxy Anchor Loss for Deep Metric Learning, CVPR 2020
MIT License
314 stars 60 forks source link

[UPDATE to code/train.py ] criterion = losses.Proxy_NCA().cuda() #16

Closed moured closed 3 years ago

moured commented 3 years ago

Thanks for this great work !!

I would like to suggest a minor update for a bug that I have found.

ERROR If you use Proxy_NCA you will most probably get this error : TypeError: init() missing 2 required positional arguments: 'nb_classes' and 'sz_embed'

Solution: Line 225 in code/train.py -> criterion = losses.Proxy_NCA().cuda() change it to : criterion = losses.Proxy_NCA(nb_classes = nb_classes, sz_embed = args.sz_embedding).cuda()

Thanks again, Moured

kdwonn commented 3 years ago

Thank you for your interest! We'll update the code for that error soon.