graphdeco-inria / gaussian-splatting

Original reference implementation of "3D Gaussian Splatting for Real-Time Radiance Field Rendering"
https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/
Other
14.82k stars 1.94k forks source link

No module named simple_knn #880

Open seanzhuh opened 4 months ago

seanzhuh commented 4 months ago

Hi, I've successfully compiled and installed simple_knn under the directory submodules/simple_knn using pip install -e .. But when I run python train.py the gaussian_model.py in scene complains that it can not find simple_knn package, however, I pip show simple_knn, it does exist. What could be the problem?

jaco001 commented 4 months ago

You use same environment?

seanzhuh commented 4 months ago

no, but when I add init.py file under simple_knn directory, then re-compiles and installs it, it works. The init.py file just contains from . import _C.

luizArlochi commented 4 months ago

i had the same problem here, did you solve it?

seanzhuh commented 4 months ago

i had the same problem here, did you solve it?

Yeah, just as I said, adding an init.py file under simple_knn directory and add from . import _C works fine for me.

luizArlochi commented 4 months ago

this didn't work for me, I was only able to solve it by adding the following lines to simple_knn.cu

#include <torch/extension.h>
#include <cfloat>

reinstalled the dependencies pip install --upgrade setuptools wheel torch

and run setup.py with pip install .

fariba87 commented 4 months ago

you can try this way while creating env:

git submodule deinit -f submodules/simple-knn git rm -f submodules/simple-knn git submodule add --force https://github.com/camenduru/simple-knn submodules/diff-surfel-rasterization git add .gitmodules git add submodules/simple-knn git commit -m "Re-added simple-knn submodule"