yfeng95 / DECA

DECA: Detailed Expression Capture and Animation (SIGGRAPH 2021)
Other
2.07k stars 418 forks source link

how can i get standard_rasterize_cuda.so #100

Open 565ee opened 2 years ago

565ee commented 2 years ago

when i run python demos/demo_reconstruct.py -i TestSamples/examples --saveDepth True --saveObj True

i have /root/.cache/torch_extensions/standard_rasterize_cuda/standard_rasterize_cuda.o
how can i get standard_rasterize_cuda.so

(py38) [root@lzh4 deca]# python demos/demo_reconstruct.py -i TestSamples/examples --saveDepth True --saveObj True  
creating the FLAME Decoder
trained model found. load /usr/anaconda3/envs/py38/lib/python3.8/site-packages/deca/data/deca_model.tar
Traceback (most recent call last):
  File "demos/demo_reconstruct.py", line 128, in <module>
    main(parser.parse_args())
  File "demos/demo_reconstruct.py", line 45, in main
    deca = DECA(config = deca_cfg, device=device)
  File "/usr/anaconda3/envs/py38/lib/python3.8/site-packages/deca/decalib/deca.py", line 50, in __init__
    self._setup_renderer(self.cfg.model)
  File "/usr/anaconda3/envs/py38/lib/python3.8/site-packages/deca/decalib/deca.py", line 53, in _setup_renderer
    set_rasterizer(self.cfg.rasterizer_type)
  File "/usr/anaconda3/envs/py38/lib/python3.8/site-packages/deca/decalib/utils/renderer.py", line 39, in set_rasterizer
    load(name='standard_rasterize_cuda', 
  File "/usr/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1080, in load
    return _jit_compile(
  File "/usr/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1318, in _jit_compile
    return _import_module_from_library(name, build_directory, is_python_module)
  File "/usr/anaconda3/envs/py38/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1701, in _import_module_from_library
    module = importlib.util.module_from_spec(spec)
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1166, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /root/.cache/torch_extensions/standard_rasterize_cuda/standard_rasterize_cuda.so: cannot open shared object file: No such file or directory
HyunsooCha commented 2 years ago

You can change the rasterizer standard to pytorch3d. Then the problem will be solved.

Yuan-TS commented 1 year ago

Hello, I also encountered the same problem, did you solve it?

Yuan-TS commented 1 year ago

You can change the rasterizer standard to pytorch3d. Then the problem will be solved.

Hello, what should I do?

xingdi1990 commented 4 months ago

You can change the rasterizer standard to pytorch3d. Then the problem will be solved.

Hello, what should I do?

I solved it by remove the "extra_cuda_cflags = ['-std=c++14', '-ccbin=$$(which gcc-7)']" on line 41 in renderer.py file

davecourtois commented 2 months ago

I make it work... first of all update your dependecies,

in install_conda.sh conda create -n $CONDA_ENV_NAME python=3.11

in requirements.txt (let pip resolve version)

to install all these requirements

pip install -r requirements.txt

numpy scipy chumpy scikit-image opencv-python PyYAML torch torchvision face-alignment kornia yacs ninja

Now fix error in ninja -v ==> ninja --version xed /home/'your user here...'/anaconda3/envs/pixie-env/lib/python3.11/site-packages/torch/utils/cpp_extension.py

When you get the error -std=c++14', '-ccbin=$$(which gcc-7)' go to the file containing the error and change values for, finanly "extra_cuda_cflags = ['-std=c++17', '-ccbin=$$(which gcc-11)']"

be sure nvcc is install and is at version 11.5 (cuda 12) for me all it work. (but it's a pain to fix all those error)

lizhaohu commented 6 days ago

When running DECA, it automatically compiles standard_rasterize_cuda, as indicated in render.py at line 39. By default, it uses gcc-7. Therefore, sometimes you need to change it to which gcc.