oandrienko / fast-semantic-segmentation

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

hi, can you give a "readme" about how to train our dataset from scratch? #5

Closed zhangyunming closed 5 years ago

zhangyunming commented 5 years ago

hi. thank you for share the code , i think maybe you can give a Short tutorial about hor to train our dataset from scratch, because somebody woul use the code to train therr own data,and modify the basenet. thanks

oandrienko commented 5 years ago

When you refer to training from scratch, do you meaning without Transfer Learning? This will probably be unfeasible since the network would most likely not converge. If you mean training from a backbone like ResNet50, you need to ideally first train PSPNet50 initialized with ResNet50 weights. OR, you can train ICNet directly from ResNet50 weights but this will lead to lower accuracies.

If you want to train using your own dataset, follow the guide here. The general procedure is summarized as:

  1. Create your own TFRecord creator script as outlined here. Then run your customized script to generate your train and eval TFRecords.
  2. Stage 0 Pretraining: Train PSPNet50 from ResNet50 weights (outlined here)
  3. Stage 1 Training: Initialize ICNet (without compression with all kernels) from the PSPNet50 weights and train until convergence.
  4. Apply compression to the resulting high accuracy ICNet model.
  5. Stage 2 Training: Retrain the compressed ICNet model to regain accuracy.
oandrienko commented 5 years ago

Hope this helps. I’m going to close the issue for now. If you provide some more, detail re-open the issue and I can try to help.

zhangyunming commented 5 years ago

ok thanks