Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于添加 pose 分支的训练问题 #2

Open
Watebear opened this issue Jun 21, 2021 · 1 comment
Open

关于添加 pose 分支的训练问题 #2

Watebear opened this issue Jun 21, 2021 · 1 comment

Comments

@Watebear
Copy link

您好,我按照您的提示,训练模型,遇到如下的问题:

  1. 请问您在使用模型标注的 pose 信息时,是对所有人脸框进行标注,还是只对 有 landmarks 的标注?
    同理,在计算 loss 的时候,是根 landmarks 保持一致吗?

  2. 在 multi-box-loss 中,我将 pose 部分与 landmarks 的处理保持一致(用 pos1 来选择)。
    将网络输出的数值:
    yaw_data = F.softmax(yaw_data)
    pitch_data = F.softmax(pitch_data)
    roll_data = F.softmax(roll_data)

     yaw_data = torch.sum(yaw_data.data * idx_tensor, dim=2) * 3 - 99
     pitch_data = torch.sum(pitch_data.data * idx_tensor, dim=2) * 3 - 99
     roll_data = torch.sum(roll_data.data * idx_tensor, dim=2) * 3 - 99
     
     yaw_p = yaw_data[pos1].view(-1, 1)
     yaw_t = yaw_t[pos1].view(-1, 1)
     pitch_p = pitch_data[pos1].view(-1, 1)
     pitch_t = pitch_t[pos1].view(-1, 1)
     roll_p = roll_data[pos1].view(-1, 1)
     roll_t = roll_t[pos1].view(-1, 1)
      
     loss_yaw = F.smooth_l1_loss(yaw_p, yaw_t, reduction='sum')
     loss_pitch = F.smooth_l1_loss(pitch_p, pitch_t, reduction='sum')
     loss_roll = F.smooth_l1_loss(roll_p, roll_t, reduction='sum')
    
     loss_yaw /= N1
     loss_pitch /= N1
     loss_roll /= N1
    

但发现 loss_yaw, loss_pitch, loss_roll 不收敛,训练几个 epoch 后:
loss_yaw /= N1
loss_pitch /= N1
loss_roll /= N1

请问这里该如何处理?
期待您的指导!谢谢!

@gengyanlei
Copy link
Owner

@Watebear

  1. 人脸姿态估计和口罩检测是类似的实现,只要检测出人脸,就需要检测出关键点、姿态
  2. 我实现的还是有一些问题,我没有遇到loss为nan的情况,但是mosaic数据增强写的不太好,需要优化,显存总是不断上涨。
  3. 我直接把hopenet的loss直接拿过来计算了,他本身存在的问题我没有解决,仅仅做了几次实验。希望你能继续改进loss设计,mosaic增强。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants