Pytorch-TextureGAN
Pytorch-TextureGAN copied to clipboard
Stuck in the while loop
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 I encounter exactly the same problem! Have you solved the problem?
Even I got the same problem after few iterations. Does anyone got the solution for this problem?
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.