longcw / faster_rcnn_pytorch

Faster RCNN with PyTorch
MIT License
1.7k stars 466 forks source link

run demo on cpu? #66

Open sajjad-askari opened 6 years ago

sajjad-askari commented 6 years ago

Hi, my computer non support cuda. I want run demo only cpu. I see this error, when run demo.py: cannot import name 'cython_nms'

Ammarah-Farooq commented 6 years ago

did your make file executed properly?

Ammarah-Farooq commented 6 years ago

I much CPU RAM you have?

Ammarah-Farooq commented 6 years ago

https://github.com/longcw/faster_rcnn_pytorch/issues/5

check this issue. translate its lines by google chinese to enlish translator. you will get your solution.

sajjad-askari commented 6 years ago

Hi Ammarah-Farooq. thanks for reply. I read #5, but not understand reply! please list actions that must be done.

very thanks.

Ammarah-Farooq commented 6 years ago

go to your demo.py file and search all lines where .cuda() is present. then remove only .cuda() from that line. then open your make.sh file and comment out these lines: echo "Compiling roi pooling kernels by nvcc..." nvcc -c -o roi_pooling.cu.o roi_pooling_kernel.cu \ -D GOOGLE_CUDA=1 -x cu -Xcompiler -fPIC -arch=sm_52

then go to your faster_rcnn_pytorch/faster_rcnn/roi_pooling/build.py file and comment out: extra_objects = ['src/cuda/roi_pooling.cu.o'] extra_objects = [os.path.join(this_file, fname) for fname in extra_objects]

now execute your make file. then run your demo.

sajjad-askari commented 6 years ago

I did all the things you said but still have this error: cannot import name 'cython_nms'.

I think it's because make.sh is not done correctly.

Ammarah-Farooq commented 6 years ago

open the file where it is indicating error then check the import commands

On Wed, Apr 4, 2018 at 9:20 AM, sajjad-askari notifications@github.com wrote:

I did all the things you said but still have this error: cannot import name 'cython_nms'.

I think it's because make.sh is not done correctly.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/longcw/faster_rcnn_pytorch/issues/66#issuecomment-378475792, or mute the thread https://github.com/notifications/unsubscribe-auth/AgYakmk2uM4_KssVakgWjKWe3pd_-XnTks5tlEoWgaJpZM4TDRzu .