rbgirshick / py-faster-rcnn

Faster R-CNN (Python implementation) -- see https://github.com/ShaoqingRen/faster_rcnn for the official MATLAB version
Other
8.13k stars 4.11k forks source link

ImportError: No module named easydict #562

Open hadign20 opened 7 years ago

hadign20 commented 7 years ago

Hi,

I'm trying to run the demo of py-faster-rcnn with python ./tools/demo.py --gpu 0 --net vgg16. I have done all the previous steps. But now I get this error:

Traceback (most recent call last): File "./tools/demo.py", line 17, in from fast_rcnn.config import cfg File "/home/hadi/Software/py-faster-rcnn/tools/../lib/fast_rcnn/config.py", line 23, in from easydict import EasyDict as edict ImportError: No module named easydict

I have installed easydict with both these commands:

sudo pip install easydict pip install easydict

Is this related to python path? I have installed both python 2.7 and 3.5. Since then I get all these python related errors. How can I fix this?

onkarganjewar commented 7 years ago

I'm not sure if this will resolve your issue or not, but it'd be worth a shot, I guess.

Make sure your python path is correct. For example, $ echo $PYTHONPATH /home/student/objectDetection/py-faster-rcnn/caffe-fast-rcnn/python

Or, try adding these lines of code at the start of demo.py import sys sys.path.insert(0,"/path/to/caffe/python")

Notice, the paths to python must be from py-faster-rcnn repository itself and not some external directory where you might have downloaded/installed the caffe by yourself. This is one of the mistakes that I did and faced many errors because of it.

Hope it helps!

guiyuliu commented 7 years ago

@onkarganjewar hello , I have installed caffe before ,should I install and make it in "/caffe-fast-rcnn "again ? what if my PYTHONPATH is /opt/caffe/python ? looking forward to your answer

onkarganjewar commented 7 years ago

@guiyuliu Yes, I do believe you should make the caffe in the cloned 'caffe-fast-rcnn' repository. Also, make sure that your $PYTHONPATH and $CAFFE_ROOT are correct i.e. set to the path within cloned fast-rcnn repository and not some external directory. For more detailed instructions, give this comment a try.

Hope this helps!