krrish94 / nerf-pytorch

A PyTorch re-implementation of Neural Radiance Fields
Other
872 stars 123 forks source link

Results of Google Colab's example #37

Open jdiazram opened 1 year ago

jdiazram commented 1 year ago

Hi, nice work with NeRF, but I have a question: I try to run the example on https://colab.research.google.com/drive/1L6QExI2lw5xhJ-MLlIwpbgf7rxW7fcz3, but even with 92.450 iter the result is close to 0.17 to Val Loss and 7.6 to PSNR without images for coarse and fine. So, why did this happen? or did I lose something? Adjunct an image with this.

Captura de Pantalla 2022-07-19 a la(s) 09 42 44

Another thing I did was uncommenting ReplicateNeRFModel, because another error appeared with this;

Captura de Pantalla 2022-07-20 a la(s) 13 13 36

Only with this action did the example run

model_coarse = ReplicateNeRFModel(
    hidden_size=128,
    num_encoding_fn_xyz=num_encoding_fn_xyz,
    num_encoding_fn_dir=num_encoding_fn_dir,
    include_input_xyz=include_input_xyz,
    include_input_dir=include_input_dir
)
# model_coarse = VeryTinyNeRFModel()
model_coarse.to(device)

# Initialize a fine-resolution model, if specified.
model_fine = ReplicateNeRFModel(
    hidden_size=128,
    num_encoding_fn_xyz=num_encoding_fn_xyz,
    num_encoding_fn_dir=num_encoding_fn_dir,
    include_input_xyz=include_input_xyz,
    include_input_dir=include_input_dir
)
# model_fine = VeryTinyNeRFModel()
model_fine.to(device)

Thx

Cospui commented 1 year ago

I also encountered this problem. It seems to be caused by bad initialization and sampling or ReLU so the training is stuck in local optima. Changing the seed (e.g., uncomment seed=1234) will work

nwangfw commented 1 year ago

I also encountered this problem. It seems to be caused by bad initialization and sampling or ReLU so the training is stuck in local optima. Changing the seed (e.g., uncomment seed=1234) will work

Thanks. How did you figure this out? You are amazing.