Skip to content

UnboundLocalError: local variable 'pcd_2' referenced before assignment with Custom COLMAP Dataset #11

@Kennethii2i

Description

@Kennethii2i

Hi!

I am trying to train DeGauss on a custom dataset (Bonn RGB-D dataset) following the README instructions regarding "Custom datasets". I prepared the data using ns-process-data (from Nerfstudio) to generate the COLMAP data, and the directory structure looks correct.

However, when I run the training, I encounter an UnboundLocalError: cannot access local variable 'pcd_2' in dataset_readers.py.

To Reproduce

  1. Process custom data to standard COLMAP format.
  2. Run training command.

Directory Structure My dataset structure appears to be a COLMAP output:

data/Bonn
└── colmap
    ├── database.db
    ├── images
    │   ├── frame_00001.png
    │   ├── ...
    ├── points3D.ply
    └── sparse
        └── 0
            ├── cameras.bin
            ├── images.bin
            └── points3D.bin

Error Log

Traceback (most recent call last):
  File ".../DeGauss/train.py", line 1469, in <module>
    training(lp.extract(args), hp.extract(args), op.extract(args), pp.extract(args), args.test_iterations,
  File ".../DeGauss/train.py", line 1345, in training
    scene = Scene2gs_mixed(dataset, foreground_gaussians, load_coarse=None, gaussians_second=background_gaussians)
  File ".../DeGauss/scene/__init__.py", line 167, in __init__
    scene_info = sceneLoadTypeCallbacks["Colmap"](args.source_path, args.images, args.eval, args.llffhold)
  File ".../DeGauss/scene/dataset_readers.py", line 1073, in readColmapSceneInfo
    scene_info = SceneInfo(point_cloud=pcd_2,
UnboundLocalError: cannot access local variable 'pcd_2' where it is not associated with a value

Potential Cause

I looked into scene/dataset_readers.py to understand the data loading logic. In readColmapSceneInfo, the code determines the dataset type by checking for specific files or naming patterns (e.g., checks for global_points.ply, dataset.json, id.txt, or "clutter" in image names).

Since my dataset is a standard COLMAP output, it does not match any of these specific conditions (use_1_user, useonthego, use_hyper, etc.). Consequently, the execution falls through all the if/elif blocks, and pcd_2 (and potentially other variables) are never initialized before SceneInfo is instantiated.

Question

Could you please guide me on how to run a custom COLMAP dataset?

  • Additionally, since the Bonn-RGBD dataset is referenced in your paper/results, would it be possible to share the training config file or the specific arguments used for that dataset? Having a working reference for the Bonn dataset would be extremely helpful to understand the expected input format and parameters.

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions