FlowNetPytorch
FlowNetPytorch copied to clipboard
RuntimeError: input1 must be contiguous
thanks for your work!!! i get some mistakes: File "/home/ilab/anaconda3/envs/sc_sfmlearner/lib/python3.7/site-packages/spatial_correlation_sampler/spatial_correlation_sampler.py", line 42, in spatial_correlation_sample stride, padding, dilation, dilation_patch) File "/home/ilab/anaconda3/envs/sc_sfmlearner/lib/python3.7/site-packages/spatial_correlation_sampler/spatial_correlation_sampler.py", line 70, in forward dH, dW) RuntimeError: input1 must be contiguous How can I solve this problem?
thank you!!!!
Hello,
See similar issue here : https://github.com/alexandrosstergiou/SoftPool/issues/6
Issue is that your input tensor is not contiguous, probably because you used some stride (something like my_tensor[..., ::2]
) or some transpose without copying. The easy solution is simply to make it contiguous, i.e. it will copy the data into a nicely shaped tensor if it's not contiguous, and do nothing if it's already contiguous :+1:
my_tensor = my_tensor.contiguous()