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

重复tless数据集训练,GADD_loss变成nan,GADD变成nan #10

Open
ldhai opened this issue Aug 11, 2022 · 3 comments
Open

重复tless数据集训练,GADD_loss变成nan,GADD变成nan #10

ldhai opened this issue Aug 11, 2022 · 3 comments

Comments

@ldhai
Copy link

ldhai commented Aug 11, 2022

嗯嗯,我们在按照步骤跑tless数据集的训练是,在第22epoch,GADD_loss变成nan;紧接着在第20epoch resume,在第41epoch,GADD_loss又变成nan;大家在训练时有遇到这个问题吗,有什么解决方法

@GANWANSHUI
Copy link
Owner

我们之前训练也有这样的问题,可以尝试在完成数据准备之后,写个脚本,通过以下的dataloader把可能有的脏数据丢掉,得到干净一些的train_pbr_mat.txt来训练:

def __getitem__(self, index):

    meta = scio.loadmat('{0}/{1}.mat'.format(self.file_path, self.list[index]))

    rgb = meta['rgb'].astype(np.float32)
    mask = meta['mask'].astype(np.float32)
    xyz = meta['xyz'].astype(np.float32)
    cls_id = meta['cls_indexes'][0][0] # start with 1
    target = meta['poses'].astype(np.float32)

    dis_xyz = np.sqrt(xyz[:, :, 0] * xyz[:, :, 0] + xyz[:, :, 1] * xyz[:, :, 1] + xyz[:, :, 2] * xyz[:, :, 2])
    mask_xyz = np.where(dis_xyz > 0.01, 1.0, 0.0).astype(np.float32)

    if mask_xyz.sum() < 50:
        return torch.tensor([-1]).long()

    filename = -1

    if np.isnan(xyz).sum() == 0 and np.isnan(rgb).sum() == 0 and np.isnan(target).sum() == 0 and np.isinf(
            xyz).sum() == 0 and np.isinf(rgb).sum() == 0 and np.isinf(target).sum() == 0 and \
            np.isnan(mask).sum() == 0 and np.isinf(mask).sum() == 0:
        filename = index

    return torch.tensor([filename]).long()

@awfniewf
Copy link

嗯嗯,我们在按照步骤跑tless数据集的训练是,在第22epoch,GADD_loss变成nan;紧接着在第20epoch resume,在第41epoch,GADD_loss又变成nan;大家在训练时有遇到这个问题吗,有什么解决方法

您好,我也遇到这个问题了,请问您按照作者给出的方法解决该问题了吗?谢谢。

@LunisolarStar
Copy link

嗯嗯,我们在按照步骤跑tless数据集的训练是,在第22epoch,GADD_loss变成nan;紧接着在第20epoch resume,在第41epoch,GADD_loss又变成nan;大家在训练时有遇到这个问题吗,有什么解决方法

您好,我也遇到这个问题了,请问您按照作者给出的方法解决该问题了吗?谢谢。
您解决了这个问题了吗?

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

4 participants