autonomousvision / occupancy_networks

This repository contains the code for the paper "Occupancy Networks - Learning 3D Reconstruction in Function Space"
https://avg.is.tuebingen.mpg.de/publications/occupancy-networks
MIT License
1.48k stars 291 forks source link

undefined symbol: cblas_sgemm_alloc #114

Open zergrisk1 opened 1 year ago

zergrisk1 commented 1 year ago

When I tried python setup.py build_ext --inplace,It fails with the error: Traceback (most recent call last): File "setup.py", line 7, in <module> from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension File "/home/baichenghuan/anaconda3/envs/mesh_funcspace/lib/python3.6/site-packages/torch/__init__.py", line 84, in <module> from torch._C import * ImportError: /home/baichenghuan/anaconda3/envs/mesh_funcspace/lib/python3.6/site-packages/torch/lib/libmkldnn.so.0: undefined symbol: cblas_sgemm_alloc How to solve it?

zergrisk1 commented 1 year ago

I also triedconda install mkl -c anaconda and conda update -n base -c defaults conda but didn't work.

jiyoonshincml commented 1 year ago

I had the same problem, and solved it by installing torch 1.0.1 !

zergrisk1 commented 1 year ago

Oh it finally works !Thanks a lot !

Blessing92 commented 1 year ago

HI, I also add the same issue, but after installing torch 1.0.1, when I run python setup.py build_ext --inplace it throws this error. Currently I am unable to solve it

building 'im2mesh.utils.libkdtree.pykdtree.kdtree' extension gcc -pthread -B /home/alphaar/anaconda3/envs/mesh_funcspace/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/alphaar/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 525 | #include "numpy/arrayobject.h" | ^~~~~ compilation terminated. error: command 'gcc' failed with exit status 1

jiyoonshincml commented 1 year ago

Try sudo apt-get install python-numpy

aalibasic commented 1 year ago

HI, I also add the same issue, but after installing torch 1.0.1, when I run python setup.py build_ext --inplace it throws this error. Currently I am unable to solve it

building 'im2mesh.utils.libkdtree.pykdtree.kdtree' extension gcc -pthread -B /home/alphaar/anaconda3/envs/mesh_funcspace/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/alphaar/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 525 | #include "numpy/arrayobject.h" | ^~~~~ compilation terminated. error: command 'gcc' failed with exit status 1

Did you figure this one out.

Blessing92 commented 1 year ago

Thanks, @jiyoonshincml it worked with your suggestion!

xiaoyang-RL9 commented 1 year ago

another method is useful: conda install mkl=2018 -c anaconda

liubohan1998 commented 1 year ago

HI, I also add the same issue, but after installing torch 1.0.1, when I run python setup.py build_ext --inplace it throws this error. Currently I am unable to solve it building 'im2mesh.utils.libkdtree.pykdtree.kdtree' extension gcc -pthread -B /home/alphaar/anaconda3/envs/mesh_funcspace/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/alphaar/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 525 | #include "numpy/arrayobject.h" | ^~~~~ compilation terminated. error: command 'gcc' failed with exit status 1

Did you figure this one out.

I solved by following the top answer: https://stackoverflow.com/questions/14657375/cython-fatal-error-numpy-arrayobject-h-no-such-file-or-directory there is a comment that:

Or, if you use cythonize() to make the ext_modules list,
include_dirs can be passed to setup()

follow that I add 'include_dirs' to setup, then it works