加载预训练模型
您好,很感谢您提供的项目!我想在superponit和superglue的预训练模型上微调自己的数据集。我使'--keypoint_encoder'=[32,64,128, 256],'--superpoint_weights'="superpoint/models/weights/superPointNet_coco_descriptor_256.pth.tar", '--pretrain_weights'="indoor",输入指令:python superpoint_glue_train.py --descriptor_dim 256 --sinkhorn_iterations 30。运行起来函数的Loss,请问我的操作有问题吗?
您好,很感谢您提供的项目!我想在superponit和superglue的预训练模型上微调自己的数据集。我使'--keypoint_encoder'=[32,64,128, 256],'--superpoint_weights'="superpoint/models/weights/superPointNet_coco_descriptor_256.pth.tar", '--pretrain_weights'="indoor",输入指令:python superpoint_glue_train.py --descriptor_dim 256 --sinkhorn_iterations 30。运行起来函数的Loss,请问我的操作有问题吗?
不好意思少打了一些内容,我运行起来的Loss开始为inf,后面为Nan,请问您知道为什么吗?我的操作有问题吗?
可能是你自己数据集和coco数据集的差距造成的,导致一开始描述子差距很大,预测的得分较小;superglue_train.py文件里损失函数代码:loss.append(-torch.log( scores[0][x][y].exp() ))改为loss.append(-torch.log( scores[0][x][y].exp() )+epison),其中epison是一个小量,设置为1e-6,可以避免得分小的时候,loss无穷大。
如果不是这个原因,试试降低学习率
torch.log(-scores[0][x][y].exp()) 与 -scores[0][x][y]应该是相等的,为什么不用-scores[0][x][y]呢?