yzcjtr / GeoNet

Code for GeoNet: Unsupervised Learning of Dense Depth, Optical Flow and Camera Pose (CVPR 2018)
MIT License
723 stars 181 forks source link

Training for depth prediction from scratch #23

Closed mengyuest closed 6 years ago

mengyuest commented 6 years ago

Hi. I am trying to train the first stage from scratch for the depth prediction. I used the preprocess code (kitti_raw_eigen, seq=3) and train code(batch_size=4, steps=350k. lr=0.0002) suggested in README.md but could not get similar result in paper. The model I used for evaluation is in the 345000th step. I am not sure is that the best model to use. Though I can use the pretrained model to get the result, I am still curious about how to train from scratch and is there anything we need to pay attention to during the training? Thanks.

yzcjtr commented 6 years ago

Hi @mengyuest , how good is your result? Did you use validation set to decide stopping point?

mengyuest commented 6 years ago

I haven't used validation set to decide the stopping point. I just keep training continuing till the end (350k), and used the last model generated(model-345000). I tried the experiment twice and got result (abs_rel sq_rel rms log_rms a1 a2 a3) as 0.1759 1.8748 6.4070 0.2563 0.7668 0.9208 0.9658 and 0.1793 2.4869 6.8202 0.2626 0.7807 0.9203 0.9637 respectively (I am also not sure why we will have different results, if having set random_seed already), which I think varied from paper a lot, but I did check the parameters several times and could not figure out what's going wrong there.

I also tried several max_steps and the result (all from the last stored models) seemed varies a lot.

max_steps=50000 (model-45000)
   abs_rel,     sq_rel,        rms,    log_rms,     d1_all,         a1,         a2,         a3
    0.1717,     1.2967,     5.8969,     0.2442,     0.0000,     0.7526,     0.9212,     0.9712

max_steps=100000 (model-95000)
   abs_rel,     sq_rel,        rms,    log_rms,     d1_all,         a1,         a2,         a3
    0.1976,     1.5867,     6.6347,     0.2804,     0.0000,     0.6902,     0.8955,     0.9598

max_steps=200000 (model-195000)
   abs_rel,     sq_rel,        rms,    log_rms,     d1_all,         a1,         a2,         a3
    0.1721,     1.5399,     6.3243,     0.2522,     0.0000,     0.7652,     0.9228,     0.9668
mengyuest commented 6 years ago

I checked each model trained there(in 350k steps) and the best I could get was from model-280000 which has

   abs_rel,     sq_rel,        rms,    log_rms,     d1_all,         a1,         a2,         a3
    0.1569,     1.3455,     6.0061,     0.2403,     0.0000,     0.7866,     0.9284,     0.9700
yzcjtr commented 6 years ago

@mengyuest Good. As I can recall, the network might overfit after being trained for too long. Also, you had better make sure your training/test split is consistent with monodepth.