hellochick / ICNet-tensorflow

TensorFlow-based implementation of "ICNet for Real-Time Semantic Segmentation on High-Resolution Images".
405 stars 153 forks source link

Six Questions about How to Train on My Own Dataset #64

Open zweigguan opened 6 years ago

zweigguan commented 6 years ago

I have already asked the same six questions under the issue #9. Because these six questions are too long and I think maybe many other people have met the same questions as I have. So I opened this new issue. Dear @hellochick, thank you very much for opening the source code of your implementation! I have few questions. Your response is very important to me!

  1. In the installation step, Does "Get restore checkpoint from Google Drive and put into model directory" means copy all of the files in the link which you have provided into my local file '/model'?
  2. What's the format of my dataset? Should it be .npy files or .mat files or something else?
  3. As you recommended, we should first learn moving mean/variance using the code python train.py --update-mean-var and freeze beta/gamma first. After some period, start to train beta/gamma variable using code python train.py --train-beta-gamma? How can I know when to stop training? In which way we can see the loss function's value?
  4. What do --update-mean-var and --train-beta-gamma means? Which layers do they freeze in the training process?
  5. Could you please give me some suggestion to choose proper LAMBDA1,2,3?
  6. Did you write evaluation functions or methods in your code? How to use it? Maybe I have asked too many questions. However, I am really confused by them. Thank you again for contributing to this marvelous work!
hellochick commented 5 years ago

Hey @Guanziwei, sorry for late reply.

Here are my answers to these six questions.

  1. I have updated the README, and also provide a script to auto download models.
  2. Your dataset should contain images and annotations, and also one text file to list all the filenames of the images and annotations.
  3. & 4. Update mean and variance means that during training phase you will update the parameters in batch normalization layers (note these two variables are not trainable). And to reach better performance, you need large batch size to update these two parameters, otherwise you will get bad results. In other words, just freeze them if your batch size is small.

And beta/gamma variables are also for batch normalization layer, but they are trainable. So it's necessary to train on beta/gamma on your own dataset.

  1. Just try it, because the author haven't provide any information of the ratio.
  2. Go to look evaluate.py and run it.
emanuelbesliu commented 4 years ago

Hey @hellochick

I'm new to all of this and please forgive my lack of knowledge. So I have a dataset with the following structure:

/jpgs//.jpg : 8uC3 RGB intensity images /uint8//.png : 8uC1 label map images /jsons//.json : geometry annotations

How do I make it work with your training algorithm?