RaymondJiangkw / COGS

[SIGGRAPH'24] A Construct-Optimize Approach to Sparse View Synthesis without Camera Pose
https://raymondjiangkw.github.io/cogs.github.io/
Other
59 stars 6 forks source link

An error occurred when estimating semantic mask #10

Closed Yuhuoo closed 1 month ago

Yuhuoo commented 1 month ago

Hi, thanks for your nice work. I have meet an error when I used the _preprocess_2_estimate_semanticmask.py to generate the mask.

File "/home/ga/software/anaconda3/envs/cogs/lib/python3.11/site-packages/torch/nn/functional.py", line 5382, in multi_head_attention_forward
    raise RuntimeError(f"The shape of the 2D attn_mask is {attn_mask.shape}, but should be {correct_2d_size}.")
RuntimeError: The shape of the 2D attn_mask is torch.Size([77, 77]), but should be (128, 128).

How can I solve it?

WeihongPan commented 1 month ago

It works for me https://github.com/mlfoundations/open_clip/issues/910#issue-2394032547

Yuhuoo commented 1 month ago

Thanks for your reply. However, I have meet another error when using the tain command training the scene

(cogs) ga@test-4U-GPU-Server:~/code/COGS$ python train.py -s demo --eval 2
Traceback (most recent call last):
  File "/data/Gaoao/code/COGS/train.py", line 20, in <module>
    from utils.loss_utils import l1_loss, norm_xy, delta_xy, predict_hierarchical_correspondence, ssim
  File "/data/Gaoao/code/COGS/utils/loss_utils.py", line 17, in <module>
    from submodules.QuadTreeAttention.FeatureMatching import QuadTreeLoFTR
  File "/data/Gaoao/code/COGS/submodules/QuadTreeAttention/FeatureMatching/__init__.py", line 10, in <module>
    from .src.loftr import LoFTR
  File "/data/Gaoao/code/COGS/submodules/QuadTreeAttention/FeatureMatching/src/loftr/__init__.py", line 1, in <module>
    from .loftr import LoFTR
  File "/data/Gaoao/code/COGS/submodules/QuadTreeAttention/FeatureMatching/src/loftr/loftr.py", line 7, in <module>
    from .loftr_module import LocalFeatureTransformer, FinePreprocess
  File "/data/Gaoao/code/COGS/submodules/QuadTreeAttention/FeatureMatching/src/loftr/loftr_module/__init__.py", line 1, in <module>
    from .transformer import LocalFeatureTransformer
  File "/data/Gaoao/code/COGS/submodules/QuadTreeAttention/FeatureMatching/src/loftr/loftr_module/transformer.py", line 7, in <module>
    from .quadtree_attention import QuadtreeAttention
  File "/data/Gaoao/code/COGS/submodules/QuadTreeAttention/FeatureMatching/src/loftr/loftr_module/quadtree_attention.py", line 9, in <module>
    from QuadtreeAttention.modules.quadtree_attention import QTAttA, QTAttB
  File "/data/Gaoao/code/COGS/submodules/QuadTreeAttention/FeatureMatching/src/loftr/loftr_module/../../../../QuadTreeAttention/QuadtreeAttention/modules/quadtree_attention.py", line 10, in <module>
    from ..functions.quadtree_attention import score_computation_op, value_aggregation_op
  File "/data/Gaoao/code/COGS/submodules/QuadTreeAttention/FeatureMatching/src/loftr/loftr_module/../../../../QuadTreeAttention/QuadtreeAttention/functions/quadtree_attention.py", line 3, in <module>
    import score_computation_cuda
ImportError: /home/ga/software/anaconda3/envs/cogs/lib/python3.11/site-packages/quadtree_attention_package-0.0.0-py3.11-linux-x86_64.egg/score_computation_cuda.cpython-311-x86_64-linux-gnu.so: undefined symbol: _ZN3c106detail14torchCheckFailEPKcS2_jRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
RaymondJiangkw commented 1 month ago

Hi, it seems to have something to do with the installation of QuadTreeAttention. You could probably also refer to their repository for help.

RaymondJiangkw commented 1 month ago

Close as no further activity.