-
Notifications
You must be signed in to change notification settings - Fork 160
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
IndexError: list index out of range #20
Comments
Hi, it seems that the code fails to read the mask. You'd better to check for which image/mask the code fails to read exactly, e.g., by printing the ID of the image before the failure. |
Yeah it worked. There was an issue with reading some of the masks. Thanks! :) |
Hi @sangwoomo and @bsahil29 I face the same issue... I have printed the seg_paths ... Every time it breaks at random point. But i have corresponding mask images in both the train and train_seg folder with same name and same dimensions. I cant understand why it fails. Can you please help me fix it? |
I'm sorry but I have no idea since I had never encountered this problem. |
In addition to missing masks, this issue can also happen when the masks have a wrong name. The mask cannot simply have the exact same name as the image.
In case you have more than one mask for the same image, it will be like:
|
I am trying to train the InstaGAN on a smaller dataset of around 40 images from both domains. But I am getting the following error :
File "/network/home/bansalsa/instagan/data/unaligned_seg_dataset.py", line 49, in read_segs
segs.append(-torch.ones(segs[0].size()))
IndexError: list index out of range
I have read the already available issues and double-checked that there is a mask for every image in the trainA and trainB folders but still I'm getting the same error. Also, the images are readable via PIL, I have checked that too.
This is the screenshot to the output that I'm getting :
What could be a reason for getting this error?
The text was updated successfully, but these errors were encountered: