Test: PtCld | Various Approaches for Point Cloud Completion

Table of contents

PointAttN

Debugging

Issues:

  1. Create Environment

  2. Test on PCN Dataset

  3. Test on C3D Dataset


References:

  1. Previous PyTorch Versions
  2. CUDA Toolkit 11.3 Downloads - NVIDIA Developer
  3. ModuleNotFoundError: No module named ‘mmcv’ - CSDN博客
    • Searched by ModuleNotFoundError: No module named 'mmcv' in DDG
  4. 【mmcv报错】ModuleNotFoundError: No module named ‘mmcv.runner - CSDN博客
    • Searched by No module named 'mmcv.runner' in DDG
  5. No force_fp32? · Issue #550 · open-mmlab/mmengine - GitHub
    • Searched by No module named 'mmcv.runner' force_fp32 in DDG
  6. docs/zh_cn/get_started/api_reference.md
    • Searched by repo:open-mmlab/mmcv runner in Branch 2.x
  7. 你好,我想问一下为什么运行 python test_c3d.py -c PointAttN.yaml后,test.log里没有日志生成? #31
    • Searched by logging.info( in Issues
  8. Size Mismatch for test_c3d.py #7

Addressing:

(2025-03-31)

  1. Create a conda environment

    • Supports:

      1. System Overview:

        1
        2
        3
        4
        5
        6
        
        zichen@zichen-X570-AORUS-PRO-WIFI:~$ lsb_release -a
        No LSB modules are available.
        Distributor ID: Ubuntu
        Description:    Ubuntu 22.04.5 LTS
        Release:        22.04
        Codename:       jammy
        
      2. GPU and NVIDIA Driver:

         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        12
        13
        
        zichen@zichen-X570-AORUS-PRO-WIFI:~$ nvidia-smi
        Tue Apr  1 01:11:13 2025       
        +-----------------------------------------------------------------------------------------+
        | NVIDIA-SMI 550.120                Driver Version: 550.120        CUDA Version: 12.4     |
        |-----------------------------------------+------------------------+----------------------+
        | GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
        | Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
        |                                         |                        |               MIG M. |
        |=========================================+========================+======================|
        |   0  NVIDIA GeForce RTX 3090 Ti     Off |   00000000:09:00.0 Off |                  Off |
        |  0%   25C    P8             34W /  450W |     729MiB /  24564MiB |      1%      Default |
        |                                         |                        |                  N/A |
        +-----------------------------------------+------------------------+----------------------+
        
      3. CUDA Toolkit is needed as GPU-version PyTorch was compiled by a certain CUDA Toolkit.

        Install the run filer2-Nv

        1
        2
        3
        4
        5
        6
        
        (base) zichen@zichen-X570-AORUS-PRO-WIFI:~$ nvcc -V
        nvcc: NVIDIA (R) Cuda compiler driver
        Copyright (c) 2005-2021 NVIDIA Corporation
        Built on Sun_Mar_21_19:15:46_PDT_2021
        Cuda compilation tools, release 11.3, V11.3.58
        Build cuda_11.3.r11.3/compiler.29745058_0
        
        1
        2
        3
        4
        5
        
        # Conda's pytorch pkg needs CTK runtime
        # conda install pytorch==1.9.0 torchvision==0.10.0 torchaudio==0.9.0 cudatoolkit=11.3 -c pytorch -c conda-forge
        
        # The torch 1.9 compiled with ctk 11.1 requires ctk 11.1 pre-installed on system.
        pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html
        
        • Without CUDA Toolkit, solely installing PyTorch 1.9.0 is not enough r1-Docs along with a runtime cudatoolkit

          There will be an error:

           1
           2
           3
           4
           5
           6
           7
           8
           9
          10
          11
          12
          
          Exception has occurred: ImportError
          /mnt/Seagate4T/anaconda3/envs/pointattn/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent
            File "/home/zichen/Projects/PointAttN/utils/train_utils.py", line 1, in <module>
              import torch
            File "/home/zichen/Projects/PointAttN/test_c3d.py", line 8, in <module>
              from utils.train_utils import *
          ImportError: /mnt/Seagate4T/anaconda3/envs/pointattn/lib/python3.8/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: iJIT_NotifyEvent
          
          # NO CUDA Toolkit installed
          (pointattn) zichen@zichen-X570-AORUS-PRO-WIFI:~/Projects/PointAttN$ nvcc -V
          Command 'nvcc' not found, but can be installed with:
          sudo apt install nvidia-cuda-toolkit
          

        (2025-04-07)

        • After the CUDA Toolkit 11.3 was installed, that error persists.

        • The PyTorch installed by conda is a cpu version:

          1
          2
          3
          4
          
          (pointattn) zichen@zichen-X570-AORUS-PRO-WIFI:~/Projects/PointAttN$ conda list
          
          pytorch            1.9.0        py3.8_cpu_0    pytorch
          torchvision        0.10.0          py38_cpu    pytorch
          
      4. The pytorch=1.9.0 is a cpu version?

        • pip’s package name is torch, not pytorch.

          1
          2
          3
          
          Pip subprocess error:
          ERROR: Could not find a version that satisfies the requirement pytorch==1.9.0 (from versions: 0.1.2, 1.0.2)
          ERROR: No matching distribution found for pytorch==1.9.0
          
        • Conda’s pytorch and PyPI’s torch are different packages, even if the version numbers match. Conda and pip packages are built differently and may link to incompatible CUDA/cuDNN versions.

      (2025-04-08)

      1. mmcv is needed by mm3d_pn2

        • Otherwise, there will an error:

           1
           2
           3
           4
           5
           6
           7
           8
           9
          10
          11
          12
          13
          
          Exception has occurred: ModuleNotFoundError
          No module named 'mmcv'
            File "/home/zichen/Projects/PointAttN/utils/mm3d_pn2/ops/__init__.py", line 1, in <module>
              from mmcv.ops import (RoIAlign, SigmoidFocalLoss, get_compiler_version,
            File "/home/zichen/Projects/PointAttN/utils/mm3d_pn2/__init__.py", line 1, in <module>
              from .ops import (nms, RoIAlign, roi_align, get_compiler_version, get_compiling_cuda_version,
            File "/home/zichen/Projects/PointAttN/models/PointAttN.py", line 10, in <module>
              from utils.mm3d_pn2 import furthest_point_sample, gather_points
            File "/home/zichen/Projects/PointAttN/test_c3d.py", line 34, in test
              model_module = importlib.import_module('.%s' % args.model_name, 'models')
            File "/home/zichen/Projects/PointAttN/test_c3d.py", line 80, in <module>
              test()
          ModuleNotFoundError: No module named 'mmcv'
          
        • pip install mmcv will build mmcv, and install: mmcv-2.2.0 mmengine-0.10.7 opencv-python-4.11.0.86 yapf-0.43.0

        • pip uninstall mmcv

      (2025-04-09)

      1. Install mmcv-1.x.

        Since mmcv-2.x, the mmcv.runner has been removed r4-CSDN,r6-GitHub, reminded by Cursor initially.

        @force_fp32() is used to constrain data type, but it can be replaced by autocast of PyTorch r5-GitHub.

         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        12
        13
        14
        15
        16
        17
        
        Exception has occurred: ModuleNotFoundError
        No module named 'mmcv.runner'
          File "/home/zichen/Projects/PointAttN/utils/mm3d_pn2/ops/furthest_point_sample/points_sampler.py", line 3, in <module>
            from mmcv.runner import force_fp32
          File "/home/zichen/Projects/PointAttN/utils/mm3d_pn2/ops/furthest_point_sample/__init__.py", line 3, in <module>
            from .points_sampler import Points_Sampler
          File "/home/zichen/Projects/PointAttN/utils/mm3d_pn2/ops/__init__.py", line 6, in <module>
            from .furthest_point_sample import (Points_Sampler, furthest_point_sample,
          File "/home/zichen/Projects/PointAttN/utils/mm3d_pn2/__init__.py", line 1, in <module>
            from .ops import (nms, RoIAlign, roi_align, get_compiler_version, get_compiling_cuda_version,
          File "/home/zichen/Projects/PointAttN/models/PointAttN.py", line 10, in <module>
            from utils.mm3d_pn2 import furthest_point_sample, gather_points
          File "/home/zichen/Projects/PointAttN/test_c3d.py", line 34, in test
            model_module = importlib.import_module('.%s' % args.model_name, 'models')
          File "/home/zichen/Projects/PointAttN/test_c3d.py", line 80, in <module>
            test()
        ModuleNotFoundError: No module named 'mmcv.runner'
        
    • Actions:

      1. Remove pytorch from requiremnts.txt as it’s a cpu version.

      2. Ask Windsurf to generate an environment.yaml for conda

         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        12
        13
        14
        15
        16
        17
        18
        19
        20
        21
        22
        23
        24
        25
        26
        27
        28
        29
        
        name: pointattn
        channels:
          - pytorch
          - conda-forge
          - defaults
        dependencies:
          - python=3.8
          # - pytorch=1.9.0
          # - torchvision==0.10.0
          # - torchaudio==0.9.0
          # - cudatoolkit=11.3
          - pip
          - h5py=3.6.0
          - matplotlib=3.4.3
          - munch=2.5.0
          - pyyaml=5.4.1
          - pip:
            - torch==1.9.0+cu111
            - torchvision==0.10.0+cu111
            - -f https://download.pytorch.org/whl/torch_stable.html
            - transforms3d
            - tensorpack
            - open3d==0.13.0
            - openmim
            - mmcv-full==1.7.2
            # Additional dependencies for building the 3rd-party modules
            - setuptools
            - wheel
            - numpy
        
      3. Create env:

        1
        
        conda env create -f environment.yml
        
      4. Specify gcc for nvcc (CUDA Toolkit 11.3), which supports gcc-10 tops, during compiling modules:

        1
        2
        3
        4
        5
        6
        
        export MAX_GCC_VERSION=10
        
        sudo apt install gcc-$MAX_GCC_VERSION g++-$MAX_GCC_VERSION
        
        sudo ln -s /usr/bin/gcc-$MAX_GCC_VERSION /usr/local/cuda/bin/gcc 
        sudo ln -s /usr/bin/g++-$MAX_GCC_VERSION /usr/local/cuda/bin/g++
        
        • The default gcc-11.4 results in an error when nvcc compiles chamfer3D:

          1
          
          /usr/local/cuda-11.3/include/crt/host_config.h:139:2: error: #error -- unsupported GNU version! gcc versions later than 10 are not supported!
          
      5. Build 3rd-party modules:

        1
        2
        3
        4
        5
        
        cd utils/ChamferDistancePytorch/chamfer3D
        python setup.py install
        
        cd utils/mm3d_pn2
        python setup.py build_ext --inplace
        

(2025-04-02)

  1. Test on the PCN Dataset

    • Supports:

      1. PCN(processed data) -> ShapeNetCompletion (10.6 GB) - Infinite Gateway (GRNet) -> OneDrive
    • Actions:

      1. Create a launch.json

        “Debug” -> “Python Debugger” -> “Python File with Arguments Debug the currently active Python file with arguments”

      2. Edit the path to dataset in PointAttN.yaml:

      3. Select Interpreter with the correct environment: pointattn.

    • Actions:

      (2025-04-28T09:14)

      1. test.log is emptyr7-Issue.

  1. Test on the Completion3D Dataset

    • Supports:

      1. Browser has no response after clicking the URL to 2048K points of Completion3D: Stanford 3D Point Cloud Completion Benchmark

        I guess its size exceed the limit of browser.

      2. Use wget to download dataset2019.zip (1.5GB):

         1
         2
         3
         4
         5
         6
         7
         8
         9
        10
        11
        
        zichen@zichen-X570-AORUS-PRO-WIFI:/mnt/Seagate4T/05-DataBank/PointAttN$ wget http://download.cs.stanford.edu/downloads/completion3d/dataset2019.zip
        --2025-04-02 23:52:45--  http://download.cs.stanford.edu/downloads/completion3d/dataset2019.zip
        Resolving download.cs.stanford.edu (download.cs.stanford.edu)... 171.64.64.22
        Connecting to download.cs.stanford.edu (download.cs.stanford.edu)|171.64.64.22|:80... connected.
        HTTP request sent, awaiting response... 200 OK
        Length: 1585860897 (1.5G) [application/zip]
        Saving to: ‘dataset2019.zip’
        
        dataset2019.zip                     100%[======================================>]   1.48G  5.14MB/s    in 4m 59s  
        
        2025-04-02 23:57:45 (5.05 MB/s) - ‘dataset2019.zip’ saved [1585860897/1585860897]
        
    • Actions:

      1. Run python3 test_c3d.py -c PointAttN_test_c3d.yaml

        Errorr8-Issue:


Code Read

Problems:

  1. How does the forward

Notes:

(2025-04-11)

  1. Model Breakdown

    • Supports:

      1. A neural network model contains 4 parts: Dataset, Network definition, Loss, Optimizer
Built with Hugo
Theme Stack designed by Jimmy