Open MarkChenYutian opened 1 year ago
For now, the fix is to resize the input image such that both width and height are multiple of 64:
I have the same problem and this fix didn't solve the problem for me
I cropped my image (originally 480 640) to 448 640 to fix this problem.
Hi, I'm trying to use
PWCDCNet
implemented in PyTorch to calculate the optical flow on some dataset with image shape of3 * 480 * 640
(C x H x W).However, when I fed the images into the network, the following error occurred:
Setting breakpoint and analyze the intermediate results in the
forward()
method ofPWCDCNet
shows that the variablesc2x
inforward()
has following shape:https://github.com/NVlabs/PWC-Net/blob/07df6eb8b22b83f4a62d18231ae4ecf9cbecce05/PyTorch/models/PWCNet.py#L182-L193
When calculating
upflow_6
, theupflow_6
has shape oftorch.Size([1, 2, 16, 20])
.And hence the exception is raised on this line:
https://github.com/NVlabs/PWC-Net/blob/07df6eb8b22b83f4a62d18231ae4ecf9cbecce05/PyTorch/models/PWCNet.py#L210
Is there any continent fix (i.e. without modifying the architecture which requires re-training the network) to this problem?
Thanks.