Detectron: ImportError: No module named c2

Created on 30 Jan 2018  ·  10Comments  ·  Source: facebookresearch/Detectron

Expected results

What did you expect to see?
test success

Actual results

What did you observe instead?
import utils.c2
ImportError: No module named c2

Detailed steps to reproduce

E.g.:

python2 $DETECTRON/tests/test_spatial_narrow_as_op.py

System information

  • Operating system: Ubuntu 14.01
  • Compiler version: gcc4.8.4
  • CUDA version: CUDA 8.0
  • cuDNN version: cuDNN 6.0
  • NVIDIA driver version: nvidia-384.111
  • GPU models (for all devices if they are not all the same): GTX 1050Ti
  • PYTHONPATH environment variable: /usr/local:/opt/ros/indigo/lib/python2.7/dist-packages:/usr/local::/home/znjs/caffe2/build:/home/znjs/caffe2/build
  • python --version output: Python 2.7.6
  • Anything else that seems relevant: ?

Most helpful comment

@YoungMagic But there is no lib folder under DETECTRON project
image

All 10 comments

Hi~ You should include /detectron/lib in your pythonpath.

Hi @earlysleepearlyup, please make sure that you have set up Python modules following the installation instructions.

Relevant extract:

Set up Python modules:

cd $DETECTRON/lib && make

@YoungMagic @ir413 Thank you very much !
I have solved this problem. Because I had installed apollo-kernel.So my PC enter the apollo-kernel automatically when boot the PC.
In this kernel,I can't driver my nvidia GPU cards. And then this problem comes out.
I tried to change my common kernel to solve this problem successfully.
Thank you !

@earlysleepearlyup could you tell me how to change the apollo kernel? I am facing the same problem as you..

@DanielNehemiah When you enter the ubuntu os,you can select the Linux x.x.x-xx-generic

Thanks! @earlysleepearlyup The issue was I had installed detectron with sudo and so detectron only works when i use sudo in the terminal

@YoungMagic But there is no lib folder under DETECTRON project
image

You just can simply add the cloned detectron path (the one that contains another subdirectory named 'detectron') to your PYTHONPATH

Ok. There is no detectron/lib anymore in this repo? Am I looking to the wrong place?

Ok. There is no detectron/lib anymore in this repo? Am I looking to the wrong place?

You just add this command export PYTHONPATH=/your/path/to/detection:$PYTHONPATH to your bashrc file.
It works on my machine.
Hope helps.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

junxiaoge picture junxiaoge  ·  3Comments

Adhders picture Adhders  ·  3Comments

743341 picture 743341  ·  4Comments

Hwang-dae-won picture Hwang-dae-won  ·  3Comments

kampelmuehler picture kampelmuehler  ·  4Comments