yihua7 / SC-GS

[CVPR 2024] Code for SC-GS: Sparse-Controlled Gaussian Splatting for Editable Dynamic Scenes
https://yihua7.github.io/SC-GS-web/
MIT License
428 stars 21 forks source link

Training NeRF-DS dataset 產生error #24

Closed cdfan0627 closed 3 months ago

cdfan0627 commented 3 months ago

您好,我目前嘗試用您的code去train NeRF-DS dataset,我使用了以下指令,可是跑了一些iteration後還是發生了下圖的error,NeRF-DS dataset的image size是480*270 CUDA_VISIBLE_DEVICES=1 python train_gui.py --source_path data/nerfds/as_novel_view --model_path outputs/nerfds/as_novel_view --deform_type node --node_num 512 --hyper_dim 2 --eval --gt_alpha_mask_as_scene_mask --local_frame --W 480 --H 270

image

我也嘗試了以下指令,可是還是出現下面的error CUDA_VISIBLE_DEVICES=1 python train_gui.py --source_path data/nerfds/as_novel_view --model_path outputs/nerfds/as_novel_view --deform_type node --node_num 512 --hyper_dim 8 --is_blender --eval --gt_alpha_mask_as_scene_mask --local_frame --resolution 2 --W 800 --H 800

image
yihua7 commented 3 months ago

Hi, It's because the downsampled resolution is too low and MS-SSIM can not be calculated, which depends on the SSIMs of different subsampled res. You can set --resolution 1 to avoid this.

hua-zi commented 1 month ago

This is because your NeRF-DS dataset file name is named nerfds. According to the code of scene/datase_readers.py, the NeRF-DS file name needs to start with NeRF to get the correct result. (Look at the ratio)

    name = path.split('/')[-2]
    if name.startswith('vrig'):
        # train_img = dataset_json['train_ids']
        train_img = dataset_json['train_ids']
        val_img = dataset_json['val_ids']
        all_img = train_img + val_img
        ratio = 0.25
    elif name.startswith('NeRF'):
        train_img = dataset_json['train_ids']
        val_img = dataset_json['val_ids']
        all_img = train_img + val_img
        ratio = 1.0
    elif name.startswith('interp'):
        train_img = list(np.array(dataset_json['ids'])[[i for i in range(len(dataset_json['ids'])) if i % 4 == 0]])
        val_img = list(np.array(dataset_json['ids'])[[i for i in range(len(dataset_json['ids'])) if i % 4 == 2]])
        all_img = train_img + val_img
        ratio = 0.5
    else:  # for hypernerf
        train_img = dataset_json['ids']
        val_img = dataset_json['ids'][:4]
        all_img = train_img + val_img
        ratio = 0.5
msk_path = [f'{path}/resized_mask/{int(1 / ratio)}x/{i}.png.png' for i in all_img]
msk_path = msk_path if os.path.exists(f'{path}/resized_mask/{int(1 / ratio)}x/') else None
all_img = [f'{path}/rgb/{int(1 / ratio)}x/{i}.png' for i in all_img]