-
Notifications
You must be signed in to change notification settings - Fork 72
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
Problem with train_generator: list index out of range #4
Comments
I think your PATH to the dataset is incorrect |
Thank you for your answer. But my PATH to the dataset is like yours. My Path is ..../datasets/VOCdevkit/VOC2012/' Is it correct, that i have 17.125 Input Images, but 2.913 SegmentationClass Images? Also, in the class "SegmentationGenerator(Sequence):" function in line 239: The length of the self.image_path_list is 17125 and the length of the self.label_path_list is 2913, so the PATH has to be correct, right? |
Obviously not.. You must have pairs of image and its mask |
Thank you for your answer. Hm, thats weird. I downloaded it from the official site: http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#devkit Is it correct that your label is a grayscale image with the value 0 for background and value 1 for class 1, value 2 for class 2 etc.? And for each object there is a shape with value 255? When i want to train DeepLab with my own data, do my label image has to have the shape with the value 255? Because i have pictures with two ropes and a background, see my post here: |
An another question: how can i save the model after the training? I don't know how to use google Colab with my own data, which are on my PC. Therfore i want to first train my data and after that i want to save the model. And then in another Python File i want to load the model and show the result the same way you did. |
If you use the VOC2012 development kit it won't be arrange as needed for the training, as it has all the jpegimages together without a split between train and test. You can split it yourself, I used the below code (set the data_dir to your directory with masks, set the image_dir to all your images, and image2_dir to where you want the train/val images to go).
You'll have to alter the utils.py to match what you want, and the same holds if you want to train it on your own dataset.
I've set my checkpointer to output the whole model (save_weights_only=False), that's the easiest way to do it probably. |
@thepate94227 Download the SegmentationClassAug folder from https://www.dropbox.com/s/oeu149j8qtbs1x0/SegmentationClassAug.zip |
Hey Golbstein,
thank you for your code. I am trying to implement it, but i get an error:
Do you know why?
In your Code in utils.py you used the folder "SegmentationClassAug" in line 247, but there is no folder with this name in VOC2012. There is one named "SegmentationClass" and "SegmentationObject". I used "SegmentationClass". And i created the folder "train", which you used in line 246, too. There i copied all the images which were in JPEGImages before.
Maybe this has to do with the error i got.
The text was updated successfully, but these errors were encountered: