ClementPinard / FlowNetPytorch

Pytorch implementation of FlowNet by Dosovitskiy et al.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sparsity in ```validation()```

yasserben opened this issue ยท comments

Hi, ๐Ÿ˜ƒ
I have a question related to the way sparsity is handled.
In the train() function we have the condition :

 if args.sparse:
            # Since Target pooling is not very precise when sparse,
            # take the highest resolution prediction and upsample it instead of downsampling target
            h, w = target.size()[-2:]
            output = [F.interpolate(output[0], (h,w)), *output[1:]]

Which interpolates the first feature map (the biggest btw) to have the same dimensions as the target in case of sparsity.
But this condition doesn't appear in validate() where sparsity of optical flow normally still remains.
So I don't know if it's on purpose but in case of sparsity the mean EPE will be computed differently from train() to validate ().
Thanks !! ๐Ÿ˜‰

Hi,

during validation, the output is always upscaled, so you don't have problems with sparsity.

Even with dense target, the EPE computed during train is not the same as EPE during validation. That's why we made differentiation between multiscale EPE, and real EPE

Thank you for your explanations !! ๐Ÿ˜ƒ