frozoul / 4K-NeRF

Official implementation of arxiv paper "4K-NeRF: High Fidelity Neural Radiance Fields at Ultra High Resolutions"
379 stars 19 forks source link

RuntimeError: CUDA error: device-side assert triggered #8

Open zf-666 opened 1 year ago

zf-666 commented 1 year ago

in https://github.com/frozoul/4K-NeRF/blob/a8fdc8e98b/run_sr.py#L829
The dimensionality of the data appears to be incorrect with the index target_4x = rgb_srgt_train[sel_b, sel_r_4x, sel_c_4x, :]

and the rgb_srsave.shape is (12096,16128,3) weird

zf-666 commented 1 year ago

this issue can be solved by change https://github.com/frozoul/4K-NeRF/blob/ddc40ef0ebeff0be87a079ae43e42d2841e06696/lib/dvgo.py#L852 to

    imsz = np.int32(imsz / sr_ratio)
    BS = np.int32(BS/sr_ratio)
    arr_all = patch_gen(imsz, num_im, BS, sz_patch)
    arr_all_sr = patch_gen(imsz*sr_ratio, num_im, BS*sr_ratio, sz_patch)

and check the shape of images in llff/fern/images_1008x756/

zhangsongdmk commented 1 year ago

Hello, it seems you run the package successfully while I am still strugglling in the pytorch & cuda version problem. Can you share me your infomation on pytorch & cuda version? many thanks.

zhangsongdmk commented 1 year ago

this issue can be solved by change

https://github.com/frozoul/4K-NeRF/blob/ddc40ef0ebeff0be87a079ae43e42d2841e06696/lib/dvgo.py#L852

to

    imsz = np.int32(imsz / sr_ratio)
    BS = np.int32(BS/sr_ratio)
    arr_all = patch_gen(imsz, num_im, BS, sz_patch)
    arr_all_sr = patch_gen(imsz*sr_ratio, num_im, BS*sr_ratio, sz_patch)

and check the shape of images in llff/fern/images_1008x756/

hello, did you meet the error "/pytorch/aten/src/ATen/native/cuda/IndexKernel.cu:142: operator(): block: [134,0,0], thread: [97,0,0] Assertionindex >= -sizes[i] && index < sizes[i] && "index out of bounds"` failed."

XLR-man commented 1 year ago

Hello, it seems you run the package successfully while I am still strugglling in the pytorch & cuda version problem. Can you share me your infomation on pytorch & cuda version? many thanks.

Did you know infomation on pytorch & cuda version

skrudrjs commented 10 months ago

arr_all = patch_gen(imsz, num_im, BS, sz_patch)

Keep the above original code intact. Instead, check that mogrify is executed properly (line 72 of load_llff.py).

And then, check the created png images in llff/fern/images_1008x756. If the resolution of png images is 1008x756, it will work without problem.

If mogrify doesn't work, using 'apt-get install imagemagick-6.q16', just install it