xingyizhou / CenterNet

Object detection, 3D detection, and pose estimation using center point detection:
MIT License
7.3k stars 1.93k forks source link

/torch/utils/ffi/../../lib/include/THC/THCGeneral.h:12:10: fatal error: cuda.h: No such file or directory #include "cuda.h" #340

Open henbucuoshanghai opened 5 years ago

henbucuoshanghai commented 5 years ago

when install DCNV2,error

xingyizhou commented 5 years ago

Please make sure your pytorch version matches the required pytorch version in the DCN repo.

wasin1994 commented 5 years ago

What is the required pytorch version in the DCN repo?

zchrissirhcz commented 4 years ago

I've just installed centernet and setup a conda environment as [INSTALL.md] illustrated, i.e. python 3.6, torch 0.4.1

My NVidia Card and CUDA: RTX 2080, CUDA 10.0

I also encounter the error "cuda.h" not found error.

I solved it by editing build.py and build_double.py, adding include_dirs=['/usr/local/cuda-10.0/include'] in create_extension( calling's last part.

e.g.:

ffi = create_extension(
    '_ext.dcn_v2_double',
    headers=headers,
    sources=sources,
    define_macros=defines,
    relative_to=__file__,
    with_cuda=with_cuda,
    extra_objects=extra_objects,
    extra_compile_args=extra_compile_args,
    include_dirs=['/usr/local/cuda-10.0/include']  #!! this line, added by me
)

Then ./make.sh run OK without compile error.

Hope this helps people with similar issue.

xxxxxxxx-dl commented 4 years ago

I've just installed centernet and setup a conda environment as [INSTALL.md] illustrated, i.e. python 3.6, torch 0.4.1

My NVidia Card and CUDA: RTX 2080, CUDA 10.0

I also encounter the error "cuda.h" not found error.

I solved it by editing build.py and build_double.py, adding include_dirs=['/usr/local/cuda-10.0/include'] in create_extension( calling's last part.

e.g.:

ffi = create_extension(
    '_ext.dcn_v2_double',
    headers=headers,
    sources=sources,
    define_macros=defines,
    relative_to=__file__,
    with_cuda=with_cuda,
    extra_objects=extra_objects,
    extra_compile_args=extra_compile_args,
    include_dirs=['/usr/local/cuda-10.0/include']  #!! this line, added by me
)

Then ./make.sh run OK without compile error.

Hope this helps people with similar issue.

You are the best. This bothers me for a really long time. And I have uninstalled and installed all kinds of versions of pytorch and dcn for thousands of times. Thank you very much for sharing the solution.