sniklaus / pytorch-pwc

a reimplementation of PWC-Net in PyTorch that matches the official Caffe version
GNU General Public License v3.0
608 stars 122 forks source link

AttributeError: module 'correlation' has no attribute 'FunctionCorrelation' #19

Closed fabiopk closed 5 years ago

fabiopk commented 5 years ago

Trying to run: python run.py --model default --first ./images/first.png --second ./images/second.png --out ./out.flo

Gives me the following output:

  File "run.py", line 315, in <module>
    tensorOutput = estimate(tensorFirst, tensorSecond)
  File "run.py", line 301, in estimate
    tensorFlow = 20.0 * torch.nn.functional.interpolate(input=moduleNetwork(tensorPreprocessedFirst, tensorPreprocessedSecond), size=(intHeight, intWidth), mode='bilinear', align_corners=False)
  File "/home/fabio/anaconda3/envs/ai/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "run.py", line 268, in forward
    objectEstimate = self.moduleSix(tensorFirst[-1], tensorSecond[-1], None)
  File "/home/fabio/anaconda3/envs/ai/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "run.py", line 196, in forward
    tensorVolume = torch.nn.functional.leaky_relu(input=correlation.FunctionCorrelation(tensorFirst=tensorFirst, tensorSecond=tensorSecond), negative_slope=0.1, inplace=False)
AttributeError: module 'correlation' has no attribute 'FunctionCorrelation' 

Using Ubunutu 18.10 Pytorch 1.0.1 CUDA 9.1 Python 3.7.2 GCC 7.3.0

Any ideias?

sniklaus commented 5 years ago

I am not sure I am afraid, your environment looks good in general. This issue came up before and was resolved by installing cupy (probably cupy-cuda91 in your case) but I do not understand how that could be the issue that is causing this behavior: https://github.com/sniklaus/pytorch-pwc/issues/7, https://github.com/sniklaus/pytorch-pwc/issues/12. What does python --version say?

fabiopk commented 5 years ago

Ok, I think I got it to work.

I used pip install cupy-cuda90 instead of 91 before.

Uninstalling cupy and reinstalling with pip install cupy-cuda91 seemed to fix the issue.

Thanks!

RokiaAbdeen commented 3 years ago

I already did what @fabiopk said but I am still getting this error AttributeError: module 'correlation' has no attribute 'FunctionCorrelation'