stable-dreamfusion icon indicating copy to clipboard operation
stable-dreamfusion copied to clipboard

TypeError: _morton3D.forward() takes 2 positional arguments but 4 were given

Open ryukra opened this issue 1 year ago • 5 comments

This error happens in the raymarching extension. Does anyone maybe know what to do with this error? I'm using Windows without WSL, does that even work?

ryukra avatar Apr 20 '23 02:04 ryukra

@ryukra Sorry that Windows is not supported to build CUDA extensions, but it seems you have installed the extensions sucessfully? But this error is still strange. Maybe you could try the vanilla/taichi backend instead.

ashawkey avatar Apr 21 '23 08:04 ashawkey

I met this error and I am using Windows without WSL as well. I fixed this issue by re-building all extensions with pip install ./{raymarching | shencoder | freqencoder | gridencoder}.

Also FYI I had a problem building the extensions with CUDA 12.1. After I downgrade CUDA to 11.7, I was able to build successfully.

ruiqixu37 avatar Jul 25 '23 22:07 ruiqixu37

having the same problem @ruiqixu37 can you explain exacly ho do you re-build the extensions? thanks in advance

joaodafonseca avatar Aug 02 '23 18:08 joaodafonseca

having the same problem @ruiqixu37 can you explain exacly ho do you re-build the extensions? thanks in advance

I just followed the build extension section in the README of the repo. Per the README, you can try pip bash scripts/install_ext.sh to install all extensions. What I used is pip install ./raymarching to rebuild the raymarching extension, and used similar commands to build the shencoder, freqencoder, gridencoder extensions.

Hope this helps!

ruiqixu37 avatar Aug 03 '23 19:08 ruiqixu37

Note: this is for people facing trouble with windows.

If you previously removed the underscore _ before the module name in lines like import _raymarching as _backend in your raymarching.py, you might have to add it back! Same with freqencoder, shenencoder, and gridencoder.

Then, you can try to rerun the program with the command you were using that gave you this error. You probably don't need to follow the previous message's advice of installing local packages via pip manually, because that happens automatically, as stated in some comments above these imports:

# lazy building: 
# `import raymarching` will not immediately build the extension, only if you actually call any functions.

Another thing you probably have to do - for me, I kept getting this error:

ModuleNotFoundError: No module named '_raymarching'

This is because I had to change everywhere where -std=c++14 was, and replace it with -std=c++17 across several files like backend.py and setup.py in each package's folder:

nvcc_flags = [
    '-O3', '-std=c++17',  # was c++14, but after changing, fixes the lazy building errors
    '-U__CUDA_NO_HALF_OPERATORS__', '-U__CUDA_NO_HALF_CONVERSIONS__', '-U__CUDA_NO_HALF2_OPERATORS__',
]

Take a look around the shencoder, raymarching, gridencoder, and freqencoder and see making that changes fixes everything for you.

rslay avatar Jun 22 '24 04:06 rslay