faster-rcnn.pytorch icon indicating copy to clipboard operation
faster-rcnn.pytorch copied to clipboard

Not compiled with GPU support (nms at /home/yuezhangw/Program/Faster_RCNN_torch101/faster-rcnn.pytorch/lib/model/csrc/nms.h:22)

Open yuezhangW opened this issue 4 years ago • 10 comments

The processing of compiling is successful, without errors but a warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++

Then, when I try train_val.py, errors occured: Not compiled with GPU support (nms at /home/yuezhangw/Program/Faster_RCNN_torch101/faster-rcnn.pytorch/lib/model/csrc/nms.h:22)

it seems like that i had not compiled nms into GPU env, but the compiling was no error. i used py36 to complie, maybe i should try py27?As a new hand, I don't know how to use a different version Python in one env, one for complie, one for run program?

SO, anyone had the same problem?Thanks for the helping!

yuezhangW avatar May 12 '20 08:05 yuezhangW

Do you have _C........pyd file after compiling in /lib or more deep folder?

loolzaaa avatar May 12 '20 15:05 loolzaaa

Do you have _C........pyd file after compiling in /lib or more deep folder?

yes, but it didn't work

yuezhangW avatar May 12 '20 15:05 yuezhangW

It seems that code can't detect CUDA device. torch.cuda.is_available() return True for you?

If yes, try to remove CUDA_HOME from this line.

Of course, i hope you use PyTorch 1.0 branch.

loolzaaa avatar May 12 '20 15:05 loolzaaa

It seems that code can't detect CUDA device. torch.cuda.is_available() return True for you?

If yes, try to remove CUDA_HOME from this line.

Of course, i hope you use PyTorch 1.0 branch.

maybe you are right, i will try it tomorrow! Much thanks to your reply!

yuezhangW avatar May 12 '20 15:05 yuezhangW

It seems that code can't detect CUDA device. torch.cuda.is_available() return True for you?

If yes, try to remove CUDA_HOME from this line.

Of course, i hope you use PyTorch 1.0 branch.

yes, I used Pytorch1.0 branch,the readme file can prove it if torch.cuda.is_available() and CUDA_HOME is not None I try to remove part of this, and it turns to

if torch.cuda.is_available() , torch.cuda.is_available() always returns Ture

then I run the file setup.py again, error occurs:

Traceback (most recent call last): File "setup.py", line 65, in ext_modules=get_extensions(), File "setup.py", line 52, in get_extensions extra_compile_args=extra_compile_args, File "/home/yuezhangw/anaconda3/envs/py36_torch101_cuda90/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 476, in CUDAExtension library_dirs += library_paths(cuda=True) File "/home/yuezhangw/anaconda3/envs/py36_torch101_cuda90/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 549, in library_paths paths.append(_join_cuda_home(lib_dir)) File "/home/yuezhangw/anaconda3/envs/py36_torch101_cuda90/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1121, in _join_cuda_home raise EnvironmentError('CUDA_HOME environment variable is not set. ' OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root. (py36_torch101_cuda90) yuezhangw@yuezhangw-PC:~/Program/Faster_RCNN_torch101/faster-rcnn.pytorch/lib$ python setup.py build develop Traceback (most recent call last): File "setup.py", line 65, in ext_modules=get_extensions(), File "setup.py", line 52, in get_extensions extra_compile_args=extra_compile_args, File "/home/yuezhangw/anaconda3/envs/py36_torch101_cuda90/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 476, in CUDAExtension library_dirs += library_paths(cuda=True) File "/home/yuezhangw/anaconda3/envs/py36_torch101_cuda90/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 549, in library_paths paths.append(_join_cuda_home(lib_dir)) File "/home/yuezhangw/anaconda3/envs/py36_torch101_cuda90/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1121, in _join_cuda_home raise EnvironmentError('CUDA_HOME environment variable is not set. ' (py36_torch101_cuda90) yuezhangw@yuezhangw-PC:/Program/Faster_RCNN_torch101/faster-rcnn.pytorch/lib$ python setup.py build develop yes Traceback (most recent call last): File "setup.py", line 66, in ext_modules=get_extensions(), File "setup.py", line 53, in get_extensions extra_compile_args=extra_compile_args, File "/home/yuezhangw/anaconda3/envs/py36_torch101_cuda90/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 476, in CUDAExtension library_dirs += library_paths(cuda=True) File "/home/yuezhangw/anaconda3/envs/py36_torch101_cuda90/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 549, in library_paths paths.append(_join_cuda_home(lib_dir)) File "/home/yuezhangw/anaconda3/envs/py36_torch101_cuda90/lib/python3.6/site-packages/torch/utils/cpp_extension.py", line 1121, in _join_cuda_home raise EnvironmentError('CUDA_HOME environment variable is not set. ' OSError: CUDA_HOME environment variable is not set. Please set it to your CUDA install root.

do you know how to deal with it?Thank you ever so much

yuezhangW avatar May 15 '20 00:05 yuezhangW

Ok, i see. You use anaconda and i suppose you install CUDA through it, so it is not the entire package.

Install CUDA drivers manually https://developer.nvidia.com/cuda-downloads

After installation, pytorch would be able to access the CUDA path. You can check it:

import os
print(os.environ.get('CUDA_PATH')

loolzaaa avatar May 15 '20 02:05 loolzaaa

Excuse me! I meet the same problem with yours, do you solve it now? if yes, please share the solution, thanks!

Chenlei6 avatar Oct 16 '20 07:10 Chenlei6

Excuse me! I meet the same problem with yours, do you solve it now? if yes, please share the solution, thanks!

sorry,i did not solve it till now

yuezhangW avatar Oct 16 '20 07:10 yuezhangW

Before compiling setup.py, you should make sure that print(torch.cuda.is_available()) returns True. I've solved this problem!

xxxjw-fighting avatar Apr 08 '21 02:04 xxxjw-fighting