NVlabs / instant-ngp

Instant neural graphics primitives: lightning fast NeRF and more
https://nvlabs.github.io/instant-ngp
Other
16k stars 1.93k forks source link

"json.exception.parse_error.110: syntax error while parsing MessagePack binary" after trying to import exported snapshot #468

Closed PeteHemery closed 2 years ago

PeteHemery commented 2 years ago

Hi there. Love love love this project!

Would like to report an issue I'm having. I'm trying to use it on my ancient GeForce GTX 765M hybrid card (using Bumblebee) that has Compute Capabilities 3.0, on Ubuntu 20.04 LTS. I've compiled some libraries that have CUDA 3.5 as the minimum to allow some ML exploration, so I know that I'm running below the minimum supported hardware. It only has 2Gb of memory so I've been carefully poking the settings to allow it to run. It does (snails pace), but still.

I've settled on this setup for my network/config:

{
    "parent" : "base.json",
    "encoding": {
        "otype": "HashGrid",
        "n_levels": 16,
        "n_features_per_level": 2,
        "log2_hashmap_size": 19,
        "base_resolution": 16
    },
    "network": {
        "otype": "CutlassMLP",
        "activation": "ReLU",
        "output_activation": "None",
        "n_neurons": 64,
        "n_hidden_layers": 0
    },

    "rgb_network": {
        "otype": "CutlassMLP",
        "activation": "ReLU",
        "output_activation": "None",
        "n_neurons": 64,
        "n_hidden_layers": 0
    }
}

I've been trying reconstruct a scene from photos of a festival in India in 2014. There are some issues I've been having regarding people's silhouettes in the foreground. After reading issue 92, I tried masking them out with alpha, but that causes holes all the way to the back of the cube from that view point.. anyway, might spin up the topic of occlusions as another issue.

This issue is about trying to export a cropped snapshot from the gui, and then open it again in the gui. Not sure if that's possible/how this works.

I may be running out of memory, but if so then it's failing silently. When I load my 89Mb model, if I try and save the snapshot from the gui, in the first few seconds it works, after that it sometimes produces a corrupted file that's 35Mb, and gives the error in the issue title, and sometimes the file is 0 bytes.

I tried tacking --save_snapshot into the command line, but that file is 0 bytes too.

With the GUI open it claims to only be using about 700Mb of memory, so not sure what's going wrong here. Managed to capture the behaviour in a screen recording: https://user-images.githubusercontent.com/1208149/162951337-c8302845-d8d2-4a01-b034-ac25b78d933d.mp4

Is it expected to be able to export cropped versions of the model? Kind regards, Pete

PeteHemery commented 2 years ago

One explanation is that I was running out of space on my drive 🤦 Good edge case to know about I guess ;) Still, it seems that the exported snapshots aren't cropped. Is that expected behaviour?

Tom94 commented 2 years ago

Hi there, yes, the crop settings are part of the renderer -- completely separate from the trained model that the snapshot contains. You could extend the Python script to write out the renderer settings that you care about (the crop window is testbed.render_aabb) and to re-set these upon load. Cheers!

PeteHemery commented 2 years ago

Hi Tom, thanks for your reply 😺 I'll have a go at that :) ~Are you accepting pull requests?~

Tom94 commented 2 years ago

I'm unsure about this one in particular -- feels oddly application-specific to have a whole extra snapshot-like file just for the crop setting.

If it was a more holistic dumping/loading functionality for the entire state of the GUI, that'd be amazing though. But please don't take this as me asking you to implement such a thing. Just putting my engineer hat on and dumping my thoughts. :)

PeteHemery commented 2 years ago

Thanks for your input, I've figured out how to take renders from the camera angle by dropping into REPL. Would be nice to have a button in the GUI to do it, but I haven't gone digging into that bit yet ;) I know PySimpleGui has a nice user settings class that could potentially be ~stolen~integrated fairly easily ;) Could have a go if you like. Will close this issue for now. Thanks for your help.