ltkong218 / FastFlowNet

FastFlowNet: A Lightweight Network for Fast Optical Flow Estimation (ICRA 2021)
MIT License
261 stars 42 forks source link

TypeError: forward() missing 1 required positional argument: 'input2' #28

Open jeepmeng opened 11 months ago

jeepmeng commented 11 months ago

Hi,I have a problem like this, how should I solve it?

Traceback (most recent call last): File "/data/FastFlowNet-main/demo.py", line 45, in output = model(input_t).data File "/root/anaconda3/envs/FastFlowNet/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "/root/anaconda3/envs/FastFlowNet/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, *kwargs) File "/data/FastFlowNet-main/models/FastFlowNet.py", line 134, in forward cv6 = torch.index_select(self.corr(f16, f26), dim=1, index=self.index.to(f16).long()) File "/root/anaconda3/envs/FastFlowNet/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) File "/root/anaconda3/envs/FastFlowNet/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) TypeError: forward() missing 1 required positional argument: 'input2'

AJingshou commented 8 months ago

Try to add @staticmethod like this: https://github.com/NVIDIA/flownet2-pytorch/blob/master/networks/correlation_package/correlation.py