Closed HWLMX closed 2 years ago
Hi, as mentioned in readme
Training Loss: We have found that circle loss provides an insightful idea for the metric learning area and shows better and fast convergence for training D3Feat. To enable it, please change the loss_type to 'circle_loss' in KPFCNN_model.py, and the hyper-paramters for circle loss can be changed in loss.py.
Hi, thank you for your prompt reply。 Actually, we ran into this problem during our training. Accuracy and other parameters drop precipitously after about 40 epochs. In it you mentioned that it may be related to the circle loss. However, we did not use circle loss in the process of training and this still happened. However, in the process of our training without the use of circular loss, this problem still occurred. Do you have any suggestions for this problem? Best regards, Mengxuan Liu
Hi, a long time ago I spent some time trying to find the reason for this network collapse problem but it can not be reproduced consistently in my setting. My suggestions are
grad_clip_norm
parameter, a smaller value usually brings a smoother training process (but may also bring a slower convergence.
https://github.com/XuyangBai/D3Feat/blob/476df5362bb398a0104266f4d1598cc54de21712/training_3DMatch.py#L108
You can also try to skip the iterator with grad_norm larger than this value. The following code can be used to skip inf
grad in pytorch, you may perform a similar check in tensorflow
# backward
loss.backward()
do_step = True
for param in self.model.parameters():
if param.grad is not None:
if (1 - torch.isfinite(param.grad).long()).sum() > 0:
do_step = False
break
if do_step is True:
self.optimizer.step()
Hi, Thank you for your excellent work. I wonder what is the circle loss in code,the paper only mentions triplet loss and contractive loss.