occupancy_networks
occupancy_networks copied to clipboard
No module named 'im2mesh.utils.libkdtree.pykdtree.kdtree'
Hi, I have some problems with code's configuration.I google it but not found a proper solution.I also follow 'conda env create -f environment.yaml ', but there's something wrong with my network that i can't download.Do you know how to fix this?
Hi @MASTERCHIEF343 , could you please provide more details to reproduce your problem? What did you try to achieve? What is the error message? ...
(mesh_funcspace) D:\TF_GPU\occupancy_networks-master>python generate.py configs/demo.yaml
Traceback (most recent call last):
File "generate.py", line 10, in
Sorry, i didn't make myself clear.This is my error,i don't know how to fix it.
Did anyone find the answer to this?
pykdtree should be automatically built when running
python setup.py build_ext --inplace
Can you verify that the build step was successful?
I am having a similar problem. After doing
python setup.py build_ext --inplace
i am seeing: running build_ext building 'im2mesh.utils.libkdtree.pykdtree.kdtree' extension gcc -pthread -B /home/mat/anaconda3/envs/mesh_funcspace/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/mat/anaconda3/envs/mesh_funcspace/include/python3.6m -c im2mesh/utils/libkdtree/pykdtree/kdtree.c -o build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.o -std=c99 -O3 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=kdtree -D_GLIBCXX_USE_CXX11_ABI=0 im2mesh/utils/libkdtree/pykdtree/kdtree.c:525:10: fatal error: numpy/arrayobject.h: No such file or directory #include "numpy/arrayobject.h" ^~~~~~~~~~~~~~~~~~~~~ compilation terminated. error: command 'gcc' failed with exit status 1
Here is how i fixed this: first you check in python where is your numpy: import numpy numpy.get_include()
and then before installing you do: export CFLAGS=-I/<path_to_include>
in my case it was: export CFLAGS=-I/home/jeremy/anaconda3/envs/mesh_funcspace/lib/python3.6/site-packages/numpy/core/include/
Thanks to @JeremyFisher's fix, I get past the same error that he's having, but then I'm immediately met with another error:
gcc -pthread -B /home/chulabhaya/anaconda3/envs/mesh_funcspace/compiler_compat -Wl,--sysroot=/ -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/home/chulabhaya/anaconda3/lib/python3.7/site-packages/numpy/core/include -fPIC -I/home/chulabhaya/anaconda3/envs/mesh_funcspace/include/python3.6m -c im2mesh/utils/libkdtree/pykdtree/_kdtree_core.c -o build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.o -std=c99 -O3 -fopenmp -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=kdtree -D_GLIBCXX_USE_CXX11_ABI=0 gcc -pthread -shared -B /home/chulabhaya/anaconda3/envs/mesh_funcspace/compiler_compat -L/home/chulabhaya/anaconda3/envs/mesh_funcspace/lib -Wl,-rpath=/home/chulabhaya/anaconda3/envs/mesh_funcspace/lib -Wl,--no-as-needed -Wl,--sysroot=/ -I/home/chulabhaya/anaconda3/lib/python3.7/site-packages/numpy/core/include build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.o build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/_kdtree_core.o -o build/lib.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.cpython-36m-x86_64-linux-gnu.so -lgomp /home/chulabhaya/anaconda3/envs/mesh_funcspace/compiler_compat/ld: build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.o: unable to initialize decompress status for section .debug_info /home/chulabhaya/anaconda3/envs/mesh_funcspace/compiler_compat/ld: build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.o: unable to initialize decompress status for section .debug_info /home/chulabhaya/anaconda3/envs/mesh_funcspace/compiler_compat/ld: build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.o: unable to initialize decompress status for section .debug_info /home/chulabhaya/anaconda3/envs/mesh_funcspace/compiler_compat/ld: build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.o: unable to initialize decompress status for section .debug_info build/temp.linux-x86_64-3.6/im2mesh/utils/libkdtree/pykdtree/kdtree.o: file not recognized: file format not recognized collect2: error: ld returned 1 exit status error: command 'gcc' failed with exit status 1
Any ideas as to what might be causing this, and how to fix it? Thanks in advance!
SOLUTION: Found the solution to my issue, in case anyone runs into the same bug in the future. Turns out it's an Anaconda related issue, which is that Anaconda is using its own linker instead of the system's linker. I followed the fix mentioned here: https://github.com/pytorch/pytorch/issues/16683#issuecomment-459982988
I managed to solve a similar problem simply by running:
conda install pytorch torchvision cudatoolkit=9.0 -c pytorch
I found a solution when I build this on windows platform. You can simply add include_dirs=[numpy_include_dir]
to each module definition in the setup.py instead of calling anything from the command-line tool.
Speaking of this, if I want to deploy this network on the Windows platform, does that means I need to change the libraries=['m'], # Unix-like specific
into .lib
?