Skip to content
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

list index out of range #5

Closed
phyuphyuthaw opened this issue Jan 9, 2019 · 9 comments
Closed

list index out of range #5

phyuphyuthaw opened this issue Jan 9, 2019 · 9 comments

Comments

@phyuphyuthaw
Copy link

error2

I am just training my dataset with this instagan model. my training dataset has 14221 images and at the first trial, it has error as show in figure when iter value is 4200. Second trial, now it stopped when iter value is 8900. It has increased a lot than the first trial. I am just adding my dataset folder under the directory /instagan/datasets.

@sangwoomo
Copy link
Owner

Hi phyuphyuthaw, it seems that there is an image which does not have a corresponding mask.
Currently the code assumes that every image has at least one corresponding mask.
Can you remove such unmatched image and try the code again please?

@phyuphyuthaw
Copy link
Author

I tried to update my dataset and trained it again. While it was running, there was error like "packet_write_wait: Connection to port 22: Broken pipe.. So I stopped running and then restart to train but now it says "visdom.ConnectionError: Error connecting to Visdom server"
How can I fix them again??

@sangwoomo
Copy link
Owner

Are you using python -m visdom.server?
If you don't want to use the visdom server, add --display_id 0 to your configuration.
junyanz/pytorch-CycleGAN-and-pix2pix#333
junyanz/pytorch-CycleGAN-and-pix2pix#230

@phyuphyuthaw
Copy link
Author

yeah. I wrote the command python -m visdom.server. And in the other terminal, the code is running well now. While it is training, can I test my dataset in next terminal? Or do I need to wait till the training is finished?

@phyuphyuthaw
Copy link
Author

Excuse me, list index out of range error is still happening, but not in the same iters value. once, I had 12000 iters value and then stopped there. My dataset has been checked and I think there is no more error in my dataset. could you please give me an advice on this case?

@sangwoomo
Copy link
Owner

sangwoomo commented Jan 10, 2019

  1. You only need to turn on one visdom server. If the visdom server is running, you can run arbitrary many train or test experiments. I recommend to run the server in the tmux session.
  2. The problematic part can be changed for every experiment, as the training set is randomly shuffled. In my experience, there are some broken images that the Python library (PIL) fails to read. Can you print which seg_path is problematic, e.g., by adding print(seg_path) to UnalignedSegDataset.read_segs method?

@phyuphyuthaw
Copy link
Author

thank you very much. here is another problem too.

initialize network with normal
initialize network with normal
model [InstaGANModel] was created
loading the model from ./checkpoints/pp/latest_net_G_A.pth
loading the model from ./checkpoints/pp/latest_net_G_B.pth
---------- Networks initialized -------------
[Network G_A] Total number of parameters : 26.815 M
[Network G_B] Total number of parameters : 26.815 M

Traceback (most recent call last):
File "test.py", line 33, in
model.test()
File "/Disk2/kaoru/related_works/instagan/models/insta_gan_model.py", line 188, in test
self.real_B_img_sng = self.fake_A_img_sng.detach()
AttributeError: InstaGANModel instance has no attribute 'fake_A_img_sng'

@sangwoomo
Copy link
Owner

It seams that some of your testB images do not have corresponding masks, hence self.forward_B had never been run. Currently, the code assumes that every image have at least one corresponding mask.

@sangwoomo
Copy link
Owner

In addition, can you open a new issue for a new question please? It would help others to find the solution for the same issue, by searching the titles of the issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants