oandrienko / fast-semantic-segmentation

ICNet and PSPNet-50 in Tensorflow for real-time semantic segmentation
220 stars 41 forks source link

some questions about training #22

Closed Jerry2990 closed 5 years ago

Jerry2990 commented 5 years ago

Thanks for your project. I have some questions.

  1. Where is the 953 file? This file is mentioned in Icnet.md. image I always get some errors in the first stage of training without it.
  2. I haven't read the code in detail. If I just use 5 classes of cityscapes to train. Do I only need to change the variable classes in config to 5? 3.I tried train from scratch using hellochick/ICNet-tensorflow(https://github.com/hellochick/ICNet-tensorflow) and the result was bad. I found your answers there. So if i train 5-classes-segmentation from 0818_pspnet_1.0_713_resnet_v1,will I get a good result? Thank you and look forward to your reply.
oandrienko commented 5 years ago

Hey @Jerry2990, thanks for your interest in the project.

  1. Sorry, I just pushed a documentation fix for this. The file was changed to have the size prefix of 1025. It is named two_stage_icnet_1.0_1025_resnet_v1_stage_1.config.
  2. I haven't played around with changing the number of classes, but I believe updating the configs is the only change you need to make. I don't think I hardcoded the class number anywhere other than the label ID to train ID mappings for inference! Let me know if this works for you.
  3. Yes, training from scratch (random initialization) will definitely provide poor results if you are using Cityscapes dataset which is really small. You will need to either do transfer learning from ImageNet weights (from ResNet-50) or transfer learning from PSPNet-50 weights as described here. I also believe the project you linked to does not implement the compression-retrain process which is also needed if you whish to reproduce the ICNet paper directly.

Hope this helps!

Jerry2990 commented 5 years ago

log.txt Thanks for your reply so quickly. @oandrienko I used two_stage_icnet_1.0_1025_resnet_v1_stage_1.config before. However, I have a question that is in the uploaded log. And, i don't know why. Did you uses python2.x? Thank you very much and look forward to your reply.

oandrienko commented 5 years ago

Shoot, @Jerry2990, yes I tested with Python 2.7 but have bee meaning for the code to be compatible with Python 3. Let me look at this on the weekend and get back to you!

oandrienko commented 5 years ago

@Jerry2990 Had the chance to look quickly and fix the problem. It was a Python 3 compatibility issue where I was trying to index a dict view. Hope this helps.