Pytorch-TextureGAN icon indicating copy to clipboard operation
Pytorch-TextureGAN copied to clipboard

Stuck in the while loop

Open BadourAlBahar opened this issue 6 years ago • 3 comments

The code gets stuck in the while loop in train.py. This happens when torch.sum(seg[i_bs,0,xstart:xend,ystart:yend]) is equal to zero at which case (k x patch_size x patch_size) will never reach zero and hence there is no exit from the loop.

Can you please explain the function of this while loop?

BadourAlBahar avatar Sep 14 '18 23:09 BadourAlBahar

@BadourAlBahar I encounter exactly the same problem! Have you solved the problem?

xiaohulugo avatar Oct 10 '18 00:10 xiaohulugo

Even I got the same problem after few iterations. Does anyone got the solution for this problem?

chandrakant-sonawane avatar Nov 17 '18 13:11 chandrakant-sonawane

It works for me when i replaced the while loop condition with 'while torch.sum(seg[i_bs,0,xstart:xend,ystart:yend]) != 0 and torch.sum(seg[i_bs,0,xstart:xend,ystart:yend]) < kpatch_sizepatch_size :'. Since torch.sum might become zero after a few loops.

Pengxiao-Wang avatar Nov 19 '18 11:11 Pengxiao-Wang