-
Notifications
You must be signed in to change notification settings - Fork 316
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
How to prepare one's own data? #47
Comments
Hi @zpge I have prepared a script that allows you train your own data using this repo's training strategy. It works on my machine with Pytorch-1.4.0 and Python-3.6.7 (Ubuntu 18.04.03). The modified training script works as well, but since I do not have sufficient training resources, I am unable to train it on my machine. Maybe we could collaborate over this, if you have not already found a solution. The following script works for me.
Apart from this you would need to create a
Once this is done, you can call |
Thanks. It's very nice of you. I will try your method. I also tried another way following https://github.com/mcordts/cityscapesScripts/tree/master/cityscapesscripts. It works for me. |
@dronefreak Thank you for the script.But since the number of classes here are different as compared to the pretrained weights,(which is on cityscapes),will it still work if we initialize the weights for training from the pretrained weights? |
Hi @poornimajd You can load the weights as it is from a pre-trained model, no issues. Just one thing that you need to be careful about is the final layers (that determine the number of classes), should be dropped, and the final layers should be fine-tuned on your new dataset. IN this case of transfer learning, you need to change the number of classes in .json script as well, because that file determines what kind of dataset your algorithm is being finetuned on. Hope this helps! |
Thanks for the reply! I actually modified the cityscape.json file similar to the camvid one which you have shown,and also the cityscape.py file i.e loading the images and ground_truth.I used 19 classes from my custom data,and since the number of classes are similar to that of the pretrained weights,I did not modify the last classification layer.But I got nan values for the iou on some classes while training.I am not sure what caused this issue. |
That may be because the classes might be under-represented. You may want to use class balancing techniques like ENet, or maybe use OHEM (Online hard example mining) loss to mitigate the under-representation issue. Also try increasing the number of training iterations. |
Thanks for the quick reply! I will try out the techniques suggested by you. |
hello, I found some problems just as you! when I try to train on pascal voc2012(have changed the pascal_info.json) ,but when i try to evaluate it . mIOU is nan! This really confused me... |
@leedoge ,as suggested by @dronefreak ,some classes were under-represented in my data.I just checked out the IOU for each class,and it was nan for some under represented classes.Hence the mean IOU will be nan.So just check IOU for each class and to get rid of nan for those under represented classes I either trained it more or just ignored those classes.The segmentation output looks good inspite of nan miou. |
I want to train on my own data. Can anyone give a short explaination on how to prepare and put the files?
The text was updated successfully, but these errors were encountered: