daigo0927/pwcnet

Error of index of list when num_levels equals output_level

JingleiSHI opened this issue · 5 comments

Hello,
Thank you very much for your code, which is very clear and helpful ! I have tried your code for optical flow estimation and got good result, but the problem occured when I want to train my own model: I have set parameter 'num_levels' = 6 and 'output_level' = 6, in this case, the length of pyramid is 7( 6 features + 1 image ) but of_estimator is only 6. I would like to know why the image is added in the end of pyramid which seems not be used in the later processing ? Thank you very much for your attention.

Yours sincerely,
Jinglei SHI

Thanks for the kind report!

I think there are two ways to solve the error.
First, limiting the parameter 'ouput_level' < 'num_levels' will easily solve the error. In this case, appending original images to the end of pyramids has no mean.

Another way is building num_levels+1 (= length of the pyramid) modules (of_estimator and context_net). In this case, we can use original image added in the last of the pyramid as a feature with the largest resolution.

I will fix my code along the first idea and remove original image from the pyramid. Thanks! :-)

Hello,
Thank you very much for the fast response, could you please tell me how much time you have used to train your model (output level = 4, num level = 6)? Because I am thinking to estimate the training time for my future work. And also, I have two more questions about your codes:

  1. If I use Batchnorm, do I need to add a parameter 'isTraining' in your '_conv_block' function to indicate training mode or test mode? (In your default configuration didn't used BatchNorm so no need to add it.)
  2. I found that you have reused Feature extractor and Flow estimator, but why Context has not been reused?
    Thank you for your attention and comprehension. :-)

Yours sincerely,
Jinglei SHI

Welcome.

On the GPU (Tesla V100) in my lab and by the default training setting, forward-backward of single data batch (4 pairs of input images) takes 0.15-20 seconds, single epoch (including forward-backward and evaluation) takes about 1 minute, so the learned model ('./model_epoch/model_3007.ckpt') was trained for about 3 days. The time measurement argument is now added into code.

And,

  1. When activating batch-normalization, it may be good to add 'isTraining' argument into '_conv_block' module. But in addition, the official implementation seems not to use batch-normalization.
  2. Each flow at a different level has a different scale, and I think it is good to prepare context net separately in order to deal with each scale effectively (than reuse single context net).

@daigo0927 and @JingleiSHI

Thank you for this PWC_Net implemented in Tensorflow.
Kindly i would like your help on the following issues;

  1. What are the procedure for training custom data set, (Do i need only images without optical flow ground truth or images and optical flow ground truth ).

  2. On testing, i get the images of opticaflow which are on the pdf, how can i get only the optical (last optical image and save it for further work).

  3. The testing consider only two frame, is there a suggestion/means to work on more than one frame extracted from video (arranged in ascending order ) and generate its corresponding opticalflow for all n-1 frames.

Answered here, please check it out.