instant-ngp icon indicating copy to clipboard operation
instant-ngp copied to clipboard

pyngp, ImportError on pyngp.cpython-37m-x86_64-linux-gnu.so: undefined symbol

Open smtabatabaie opened this issue 3 years ago • 11 comments

I'm trying to run it on Google Colab, and I'm following this guide: https://github.com/NVlabs/instant-ngp/blob/master/notebooks/instant_ngp.ipynb Everything builds without any errors, when I try to run the run.py code (which is the 8th step of the mentioned link) I get this error:

Traceback (most recent call last):
  File "scripts/run.py", line 29, in <module>
    import pyngp as ngp # noqa
ImportError: /content/instant-ngp/build/pyngp.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNK3ngp7Testbed16crop_box_cornersEb

I saw this issue in which the compiler couldn't find pyngp and there was a suggestion to specify the build folder #43 , so I also tried adding the lines to specify the build folder in run.py, but still no luck.

pyngp_path = '\build'
sys.path.append(pyngp_path)
import pyngp as ngp  # this line should already be there near the top of the code

I'd appreciate it if someone could help me with this.

smtabatabaie avatar Sep 15 '22 16:09 smtabatabaie

I'm having the same problem.

domef avatar Sep 16 '22 09:09 domef

I just found out that instant-ngp/build/testbed works.

domef avatar Sep 16 '22 09:09 domef

I just found out that instant-ngp/build/testbed works.

Thanks @domef , you mean I should set my path to build/testbed in run.py?

smtabatabaie avatar Sep 16 '22 09:09 smtabatabaie

No, I mean that you can directly run instant-ngp/build/testbed, it is the equivalent of run.py but compiled from c++. (it should have about the same options). With testbed I'm able to train nerf on colab.

domef avatar Sep 16 '22 09:09 domef

~~I see now that testbed has many less options than run.py, but at the moment I think it's a good fallback.~~

Edit: there are few options in testbed , so actually it's pretty hard to work in headless mode. I can't even save a checkpoint or set the number of steps.

domef avatar Sep 16 '22 12:09 domef

That's unfortunate, If @andreykramer who's wrote the guide could help us it would be great.

smtabatabaie avatar Sep 16 '22 12:09 smtabatabaie

I think I will try to compile some older versions of instant-ngp and see if they work.

domef avatar Sep 16 '22 12:09 domef

I managed to run run.py and train on the fox dataset in headless mode by checking out the commit add notebook with guide for execution in colab : git checkout 50ed131f0e296801d4b3d09ff58295add2af42fa.

domef avatar Sep 16 '22 13:09 domef

T

I managed to run run.py and train on the fox dataset in headless mode by checking out the commit add notebook with guide for execution in colab : git checkout 50ed131f0e296801d4b3d09ff58295add2af42fa.

Thanks very much, saved my day!

smtabatabaie avatar Sep 17 '22 06:09 smtabatabaie

Can you please explain to me how you managed to run run.py in colab notebook Thank you

taruntiwar avatar Sep 19 '22 11:09 taruntiwar

I followed the instructions in https://github.com/NVlabs/instant-ngp/blob/master/notebooks/instant_ngp.ipynb with the following branch https://github.com/NVlabs/instant-ngp/commit/50ed131f0e296801d4b3d09ff58295add2af42fa.

domef avatar Sep 20 '22 20:09 domef

I just verified that the last working commit is 25dec33c253f035485bb2e1f8563e12ef3134e8b.

domef avatar Sep 21 '22 22:09 domef

I just verified that the last working commit is 25dec33c253f035485bb2e1f8563e12ef3134e8b.

Thanks, this sure will be helpful to find out what's wrong.

That's unfortunate, If @andreykramer who's wrote the guide could help us it would be great.

Unfortunately I don't know this repo deeply enough to have a clue of what may have broken the compilation nor how to fix it in the guide.

andreykramer avatar Sep 22 '22 06:09 andreykramer

i am also facing the same issue please guide me how to solve this problem ? to train the model ?

sumanttyagi avatar Sep 22 '22 11:09 sumanttyagi

I followed the instructions in https://github.com/NVlabs/instant-ngp/blob/master/notebooks/instant_ngp.ipynb with the following branch 50ed131.

Follow the instructions specified in the notebook but use the same commit I used.

domef avatar Sep 23 '22 08:09 domef

I get the same error with python with headless even with the branch

saisurbehera avatar Sep 25 '22 18:09 saisurbehera

Likewise, just tried to run it today and got issues with both of the suggested branches.

akbazuka avatar Oct 02 '22 16:10 akbazuka

Hi, I made a PR which fixes this issue, in the meantime, see here: https://github.com/NVlabs/instant-ngp/pull/991

SamDM avatar Oct 03 '22 12:10 SamDM