gsplat icon indicating copy to clipboard operation
gsplat copied to clipboard

When specifying --data_factor 4 in simple_trainer.py, it results in “images_4 does not exist”.

Open BelugaIsCute opened this issue 3 months ago • 6 comments

I apologize if the text is difficult to read due to the use of a translation.

As the title suggests, I tried performing downsampling by specifying --data_factor 4.Then the following error was displayed. ValueError: Image folder data\...\images_4 does not exist.

If everything is working correctly, folders like images_4 for data_factor_4 and images_2 for data_factor_2 should be generated, and the downsampled images saved there. However, in my case, this step seems to be skipped. Note that training proceeds without issues when data_factor is set to 1 without downsampling.

Do I need to modify simple_trainer.py?

BelugaIsCute avatar Sep 25 '25 03:09 BelugaIsCute

I noticed the same thing. you can fix it by removing the for loop with the folder check in datasets/colmap.py:

image_dir = os.path.join(data_dir, "images" + image_dir_suffix) for d in [image_dir, colmap_image_dir]: if not os.path.exists(d): raise ValueError(f"Image folder {d} does not exist.")

I'm not sure if this is the correct fix, but it works. Also the created folders are actually named "images_4_png" by the script, so I'm not sure what this check is for if it doesn't even use the folder.

RieGo avatar Sep 25 '25 07:09 RieGo

Thx for sharing the solution. I removed the for loop and folder check and tried running it again, but I get an IndexError: list index out of range. Were there any other areas you fixed?

BelugaIsCute avatar Sep 26 '25 02:09 BelugaIsCute

actually I changed several things in this file, so I'm not sure. This is the part in my file:

    # Load images.
    colmap_image_dir = os.path.join(data_dir, "images")
    if not os.path.exists(colmap_image_dir):
        raise ValueError(f"Image folder {colmap_image_dir} does not exist.")
    if factor > 1:
        # If downsampling, define the target folder for PNGs
        image_dir = os.path.join(data_dir, f"images_{factor}_png")
        # If this folder doesn't exist, create it by downsampling the original images
        if not os.path.exists(image_dir):
            _resize_image_folder(
                image_dir=colmap_image_dir, 
                resized_dir=image_dir, 
                factor=factor
            )
    else:
        # If not downsampling (factor=1), just use the original images folder
        image_dir = colmap_image_dir
    # Downsampled images may have different names vs images used for COLMAP,

RieGo avatar Sep 26 '25 05:09 RieGo

Thank you, that's a great help. I'll keep exploring solutions !

BelugaIsCute avatar Sep 26 '25 07:09 BelugaIsCute

A simple workaround is to create a folder with a bunch of dummy files with the same name as your fullsize image set. This will trigger the internal rescaler to downsample the images into PNG. Alternatively, you can also use ffmpeg to downsample into an image_4_png folder directly. Regardless, you must have the images_4 folder with all the image files (though gsplat does not use them)

frankgu968 avatar Oct 15 '25 05:10 frankgu968

Thank you for your response. I'll give it a try. In any case, I feel more confident doing the downsampling myself before running that...

BelugaIsCute avatar Oct 17 '25 08:10 BelugaIsCute