Coder Social home page Coder Social logo

NaN in training about enerf HOT 8 CLOSED

chky1997 avatar chky1997 commented on August 25, 2024
NaN in training

from enerf.

Comments (8)

haotongl avatar haotongl commented on August 25, 2024

Hi, I have encountered NaN during training in the following situations, and can be avoided by using corresponding methods:

  1. When using pytorch 1.7. or 1.8, there may be NaN bugs. Using 1.9.0 or 1.6.0 always solves the problem.
  2. Change this line to: std = torch.clamp_min(var, 1e-8).sqrt()
    std = var.sqrt()

from enerf.

chky1997 avatar chky1997 commented on August 25, 2024

Solved! Thank you for your advice!

from enerf.

chky1997 avatar chky1997 commented on August 25, 2024

Hi, I met another problem during training.

  1. It seems like that the network can not converge.
    At the beginning of training, the PSNR of training set is only about 10 and ends up at about 11 after epoch 0. When it comes to the zjumocap data, the PSNR is more than 20 at first and increases fast to about 25 after epoch 0.
  2. The PSNR of test set is much higher than training set.
    After several epochs, the PSNR of training set reamins 11-12, but the PSNR of test set can increases to about 22.
    屏幕截图 2023-01-23 122434
    I wonder if I should adjust the config or there is something wrong with my dataset (I follow the tutorial of Easymocap). Thank you for your help!

from enerf.

haotongl avatar haotongl commented on August 25, 2024

Hi, what kind of data did you use? Is it similiar to ZJU-Mocap (Multi-view dynamic dataset, including mask information)?
Could you provide more information so I can locate the problem?

from enerf.

chky1997 avatar chky1997 commented on August 25, 2024

I use 4 cameras to record and extract images (1280x720, padding to 1280x1280 and resize to 1024x1024).

I also use a segmentation model to get the mask information.

I set the train input view in the yaml and the length of source view in enerf.py to avoid out of range.

b5e05239ab95825e4217379534e28a5

b9b125eeaeef6bb96718f1d0415e257

At first I think the calibration from Easymocap is not correct. But I use Matlab to double check it and the two results are close.

from enerf.

haotongl avatar haotongl commented on August 25, 2024

Try to use more source views, (one input view is not enough).
train_input_views: [3,4] train_input_views_prob: [0.5, 0.5] test_input_views: 3(or 4)

I have some other suggestions:

  1. Try rendering a test image from the remaining 3 images instead of using the GUI to render a novel view. This helps avoid extrapolation problems, which image-based rendering is not good at.
  2. Use 4 views as training views: Change these two lines to [0,-1,1] https://github.com/zju3dv/ENeRF/blob/master/configs/enerf/zjumocap/zjumocap_train.yaml#L28

from enerf.

chky1997 avatar chky1997 commented on August 25, 2024

I followed your advice and tried, but the result seems the same. Both the PSNR and the visualization are still bad.

  1. Actually, when I use the same yaml for training, with zjumocap (only use 4 cameras data) and my dataset. The result of zjumocap seems good. Only after epoch 0, PSNR of zjumocap (4 cameras) can raise from 20 to 25. For my dataset, it only begins with 10 and ends up with 13. The initial network can get such results with different data and same training strategy. So it has to be my data or my calibration that cause the difference, right?

  2. I also checked the depth_range calculated by the 3D bbox. It usually ranges from 2 to 4.5 in CoreView313. But for my dataset it ranges from 0.1 to 0.5, and sometimes the value is negative. Is that a problem?

Thank you so much for your help these days!

from enerf.

chky1997 avatar chky1997 commented on August 25, 2024

As far as I know, it is the normalization of the extrinsics that cause the problem.
微信图片_20230131105725
After the modification, everything seems good.
And I deleted the images above for privacy.
Thank you for your help and your great work!

from enerf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.