switchablenorms / CelebAMask-HQ

A large-scale face dataset for face parsing, recognition, generation and editing.
2.13k stars 352 forks source link

IndexError: index 7 is out of bounds for dimension 0 with size 7 #81

Open ssbilakeri opened 3 years ago

ssbilakeri commented 3 years ago

During training, after 3080 step, in the following loop in "trainer.py"

# image infor on tensorboardX
        img_combine = imgs[0]
        real_combine = label_batch_real[0]
        predict_combine = label_batch_predict[0]
        for i in range(1, self.batch_size):
            **img_combine = torch.cat([img_combine, imgs[i]], 2)**
            real_combine = torch.cat([real_combine, label_batch_real[i]], 2)
            predict_combine = torch.cat([predict_combine, label_batch_predict[i]], 2)
        writer.add_image('imresult/img', (img_combine.data + 1) / 2.0, step)
        writer.add_image('imresult/real', real_combine, step)
        writer.add_image('imresult/predict', predict_combine, step)

Im getting the below error.

"IndexError: index 7 is out of bounds for dimension 0 with size 7"

Please help me in this regard

Thanks

DanielXu123 commented 2 years ago

Hey, @ssbilakeri , have you figured out how to solve this problem ?

DanielXu123 commented 2 years ago

@ssbilakeri All these "writer" related stuff seems being used in tensorboard. So, if u don't need tensorboard to show some results, those "writer" related codes can be removed.