lmb-freiburg / flownet2

FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks
https://lmb.informatik.uni-freiburg.de/Publications/2017/IMKDB17/
Other
1k stars 318 forks source link

DataAugmentationLayer error: shape mismatch #52

Closed yaochx closed 7 years ago

yaochx commented 7 years ago

when I run python code with two 640x480 images, it worked fine ./scripts/run-flownet-many.py ./models/FlowNet2-css/FlowNet2-css_weights.caffemodel ./models/FlowNet2-css/FlowNet2-css_deploy.prototxt However, I run the C++ code, the caffe code tell the following error:

Cannot copy param 1 weights from layer 'img0s_aug'; shape mismatch. Source param shape is 1 3 384 768 (884736); target param shape is 1 3 480 640 (921600). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.

I found these comments which showed the possible reason?

template void DataAugmentationLayer::LayerSetUp(const vector<Blob>& bottom, const vector<Blob>& top) // TODO This won't work when applying a net to images of size different from what the net was trained on

It's very odd that python code worked, but c++ code did not work. could you tell me the underlying? Thanks @eddy-ilg @nikolausmayer @mbuckler

nikolausmayer commented 7 years ago

Hi, I'd guess your C++ code does some initialization step incorrectly. The augmentation layer should not perform geometry augmentation during testing, only mean subtraction (which does not have an associated blob shape).

nikolausmayer commented 7 years ago

Closing this issue due to no further replies. If the issue persists, please reply and we will reopen.