Skip to content

I got the error when running demo.py #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jojotata opened this issue Oct 28, 2015 · 26 comments
Closed

I got the error when running demo.py #8

jojotata opened this issue Oct 28, 2015 · 26 comments

Comments

@jojotata
Copy link

Hi.
I already successfully run fast-rcnn code written by the same author of this.
Then, I would like to try to use faster-rcnn..
However, when I run demo.py, I got this error.
'''
Traceback (most recent call last):
File "./demo.py", line 18, in
from fast_rcnn.test import im_detect
File ".../py-faster-rcnn-master/tools/../lib/fast_rcnn/test.py", line 17, in
from fast_rcnn.nms_wrapper import nms
File ".../py-faster-rcnn-master/tools/../lib/fast_rcnn/nms_wrapper.py", line 11, in
from nms.gpu_nms import gpu_nms
ImportError: No module named gpu_nms
'''
Anyone has any idea about this error?
Thank you.

@rbgirshick
Copy link
Owner

Did you run make in the lib directory?

@jojotata
Copy link
Author

Oh, I'm sorry.
I haven't run "make" yet.

I really enjoy using your 'fast-rcnn'.
My ultimate goal is to run 'fast-rcnn' or 'faster-rcnn' with pretrained ImageNet model.
So, perheps I may ask some questions again.
Thank you.

jhung0 pushed a commit to jhung0/py-faster-rcnn that referenced this issue Feb 8, 2016
@desaipratik1991
Copy link

desaipratik1991 commented May 12, 2016

Hi,
when I run faster-rcnn demo.py, I got this error.
r\tools..\lib\fast_rcnn\nms_wrapper.py", line 9, in
from nms.gpu_nms import gpu_nms
ImportError: No module named gpu_nms

I already run python setup.py file (Lib folder)

without using Make file is there any problem with that??

Thank you

@ghost
Copy link

ghost commented Jun 6, 2016

I'm also facing the same issue even though I have done make already. Please help

@joyivan
Copy link

joyivan commented Jun 7, 2016

I faced the same problem too ?anyone solved it ?

@joyivan
Copy link

joyivan commented Jun 7, 2016

Traceback (most recent call last):
File "test_net.py", line 13, in
from fast_rcnn.test import test_net
File "/home/joyian/py-faster-rcnn/tools/../lib/fast_rcnn/test.py", line 17, in
from fast_rcnn.nms_wrapper import nms
File "/home/joyian/py-faster-rcnn/tools/../lib/fast_rcnn/nms_wrapper.py", line 9, in
from nms.gpu_nms import gpu_nms
ImportError: No module named gpu_nms

@deshanadesai
Copy link

deshanadesai commented Jun 19, 2016

I was facing the same error while trying to use RCNN in CPU-only mode.

I fixed it by going to /FRCNN/py-faster-rcnn/lib/fast_rcnn/nms_wrapper.py and changing the code as follows:


from fast_rcnn.config import cfg
#from nms.gpu_nms import gpu_nms
from nms.cpu_nms import cpu_nms

def nms(dets, thresh, force_cpu=False):
    """Dispatch to either CPU or GPU NMS implementations."""

    if dets.shape[0] == 0:
        return []
    #if cfg.USE_GPU_NMS and not force_cpu:
    #    return gpu_nms(dets, thresh, device_id=cfg.GPU_ID)
    else:
        return cpu_nms(dets, thresh)

Commented out GPU-specific lines.

@dantp-ai
Copy link

dantp-ai commented Dec 5, 2016

This holds also for py-R-FCN if run in CPU mode.

@PetreanuAndi
Copy link

So GPU mode is still not solved? I want to run on GPU, but can't go over the "ImportError: No module named nms.gpu_nms " I have run make all over, and i think my caffe has all the paths set right (python and all) because it builds right. :(

@hadign20
Copy link

hadign20 commented May 1, 2017

same here for gpu. Is there any solution?

@janaka1984
Copy link

how can detect multiple object on same image using demo.py ????????????

@will7200
Copy link

The issue most likely is that the setup.py file did not locate your cuda directory, so make sure that CUDAHOME env variable is pointing to the right directory, and make again.

@fujingling
Copy link

I face the error " image not found",anyone knows how to solve it. thanks!
the detail error as follows:
zhongzunfadeMacBook-Air:tools zhongzunfa$ python demo.py
Traceback (most recent call last):
File "demo.py", line 17, in
from fast_rcnn.test import im_detect
File "/Users/zhongzunfa/fjl/py-faster-rcnn/tools/../lib/fast_rcnn/test.py", line 16, in
import caffe
File "/Users/zhongzunfa/fjl/py-faster-rcnn/tools/../caffe-fast-rcnn/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver
File "/Users/zhongzunfa/fjl/py-faster-rcnn/tools/../caffe-fast-rcnn/python/caffe/pycaffe.py", line 13, in
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver,
ImportError: dlopen(/Users/zhongzunfa/fjl/py-faster-rcnn/tools/../caffe-fast-rcnn/python/caffe/_caffe.so, 2): Library not loaded: libcaffe.so.1.0.0-rc3
Referenced from: /Users/zhongzunfa/fjl/py-faster-rcnn/caffe-fast-rcnn/python/caffe/_caffe.so
Reason: image not found

NaxAlpha pushed a commit to NaxAlpha/py-faster-rcnn that referenced this issue Nov 8, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@ghost
Copy link

ghost commented Jan 24, 2018

@deshanadesai : or a cleaner solution when the folloxing problem occurs: 'ImportError: No module named gpu_nms'

from fast_rcnn.config import cfg
if cfg.USE_GPU_NMS:
        from nms.gpu_nms import gpu_nms
from nms.cpu_nms import cpu_nms

@thezida
Copy link

thezida commented May 30, 2018

Anyone solved the problem yet?

@msha096
Copy link

msha096 commented May 13, 2019

try this
import pyximport
pyximport.install()

@wangxing1212
Copy link

@msha096
I tried your method, but there was a mistake.
"CompileError: command 'gcc' failed with exit status 1\n"

@msha096
Copy link

msha096 commented May 28, 2019 via email

@wangxing1212
Copy link

@msha096 cuda:8.0,gcc:4.9.3,I succeeded in another way.

@Chida15
Copy link

Chida15 commented Jul 31, 2019

@msha096 cuda:8.0,gcc:4.9.3,I succeeded in another way.

How do you deal with it? I also face the problem!

@wangxing1212
Copy link

@Chida15 You can switch to the Lib file, make

@3bood86
Copy link

3bood86 commented Sep 20, 2019

hello all
thanks for the great efforts

i am beginner in this field and i want to run the code

when i ran it i got this error

ModuleNotFoundError Traceback (most recent call last)
in
1 import _init_paths
2 import tensorflow as tf
----> 3 from fast_rcnn.config import cfg
4 from fast_rcnn.test import im_detect
5 from fast_rcnn.nms_wrapper import nms

ModuleNotFoundError: No module named 'fast_rcnn'

what should i do to fix it,
and where i can get the right steps?

@khan958
Copy link

khan958 commented Oct 17, 2019

Same Problem with
ModuleNotFoundError: No module named 'nms.cpu_nms'

Any one who have solved this problem yet?

@ignvinay
Copy link

I am also facing same issue :
(tf_gpu) C:\Projects\new_caffe_fasterRCNN\py-faster-rcnn>python tools\demo.py
Traceback (most recent call last):
File "tools\demo.py", line 18, in
from fast_rcnn.test import im_detect
File "C:\Projects\new_caffe_fasterRCNN\py-faster-rcnn\tools..\lib\fast_rcnn\test.py", line 17, in
from fast_rcnn.nms_wrapper import nms
File "C:\Projects\new_caffe_fasterRCNN\py-faster-rcnn\tools..\lib\fast_rcnn\nms_wrapper.py", line 10, in
from nms.cpu_nms import cpu_nms
ImportError: DLL load failed: The specified module could not be found.

@zhou3968322
Copy link

please use python 3.7.5, 3.7.4 python gpu_nms run failed.

@atursams
Copy link

atursams commented Mar 22, 2021

I'm having the same problem :D

File "/root/plasticbag-faster-rcnn/tools/../lib/model/nms_wrapper.py", line 12, in <module>
from nms.gpu_nms import gpu_nms
ImportError: No module named gpu_nms

This is what my nms folder looks like:

ls lib/nms
__init__.py  __init__.pyc  cpu_nms.c  cpu_nms.cpython-35m-x86_64-linux-gnu.so  cpu_nms.pyx  gpu_nms.cpp  gpu_nms.cpython-35m-x86_64-linux-gnu.so  gpu_nms.hpp  gpu_nms.pyx  nms_kernel.cu  py_cpu_nms.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests