CelebAMask-HQ icon indicating copy to clipboard operation
CelebAMask-HQ copied to clipboard

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

Open ssbilakeri opened this issue 4 years ago • 2 comments

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

ssbilakeri avatar Dec 22 '20 11:12 ssbilakeri

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

DanielXu123 avatar Mar 29 '22 11:03 DanielXu123

@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.

DanielXu123 avatar Mar 30 '22 06:03 DanielXu123