cv-stuttgart / CCMR

[WACV 2024] Code for "CCMR: High Resolution Optical Flow Estimation via Coarse-to-Fine Context-Guided Motion Reasoning"
Other
15 stars 2 forks source link

*** AttributeError: module 'alt_cuda_corr' has no attribute 'forward' #4

Open Harsh188 opened 3 months ago

Harsh188 commented 3 months ago

What I ran: python evaluate.py --model_type "CCMR+" --model models/CCMR+_kitti.pth --dataset kitti

Log:

Cross-att XCA
Cross-att XCA
Cross-att XCA
Cross-att XCA
Self-att XCiT
Self-att XCiT
Self-att XCiT
Self-att XCiT
Model CCMR+ initiated! :)
  0%|                                                                                                            | 0/200 [00:00<?, ?it/s]/home/hmohan/miniconda3/envs/ccmr/lib/python3.10/site-packages/torch/functional.py:568: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at  /opt/conda/conda-bld/pytorch_1646755897462/work/aten/src/ATen/native/TensorShape.cpp:2228.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
/home/hmohan/Programming/T-FlowModels/CCMR/core/xcit.py:74: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
  dim_t = self.temperature ** (2 * (dim_t // 2) / self.hidden_dim)
  0%|                                                                                                            | 0/200 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/home/hmohan/Programming/T-FlowModels/CCMR/evaluate.py", line 237, in <module>
    validate_kitti(model.module, iters=kitti_iters)
  File "/home/hmohan/miniconda3/envs/ccmr/lib/python3.10/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/hmohan/Programming/T-FlowModels/CCMR/evaluate.py", line 169, in validate_kitti
    flow_low, flow_pr = model(image1, image2, iters=iters, test_mode=True)
  File "/home/hmohan/miniconda3/envs/ccmr/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/hmohan/Programming/T-FlowModels/CCMR/core/CCMR.py", line 140, in forward
    corr= corr_fn(coords1)
  File "/home/hmohan/Programming/T-FlowModels/CCMR/core/broad_corr.py", line 59, in __call__
    corr = alt_corr(fmap1_i, fmap2_i, coords_i, r)          # b, 1, (2r+1)^2, h, w
  File "/home/hmohan/Programming/T-FlowModels/CCMR/core/broad_corr.py", line 34, in alt_corr
    return AltCorrFunction.apply(fmap1, fmap2, coords, radius)
  File "/home/hmohan/Programming/T-FlowModels/CCMR/core/broad_corr.py", line 19, in forward
    corr, = alt_cuda_corr.forward(fmap1, fmap2, coords, radius)
AttributeError: module 'alt_cuda_corr' has no attribute 'forward'
az-ja commented 3 months ago

You probably did not compile the cuda module (see readme). After compiling the cuda module with a compatible Pytorch and gcc compiler, it will work. The alternate cuda corralation module was also a part of RAFT's code. You may want to follow those issues as well.