nerfstudio-project / nerfacc

A General NeRF Acceleration Toolbox in PyTorch.
https://www.nerfacc.com/
Other
1.37k stars 113 forks source link

Saving a model #178

Closed YugAjmera closed 1 year ago

YugAjmera commented 1 year ago

Hi. Can you give a sample code to save a trained model?

YugAjmera commented 1 year ago

Currently doing it as,

path = 'checkpoints/dnerf_og.pth'
save_dict = {
    'occ_grid': occupancy_grid,
    'model': radiance_field.state_dict(),
    'optimizer_state_dict': optimizer.state_dict(),
}
torch.save(save_dict, path)
print('Saved checkpoints at', path)
DJNing commented 4 months ago

Hi, then how do you load the occupancy grid?