1

I am getting this error while importing caffe in ipython.

ImportError                               Traceback (most recent call last)
<ipython-input-1-1cca3aa1f8c5> in <module>()
----> 1 import caffe

/home/harshita/deep-learning/caffe/python/caffe/__init__.py in <module>()
----> 1 from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver
      2 from ._caffe import set_mode_cpu, set_mode_gpu, set_device, Layer, get_solver, layer_type_list, set_random_seed
      3 from ._caffe import __version__
      4 from .proto.caffe_pb2 import TRAIN, TEST
      5 from .classifier import Classifier

/home/harshita/deep-learning/caffe/python/caffe/pycaffe.py in <module>()
     11 import numpy as np
     12 
---> 13 from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
     14         RMSPropSolver, AdaDeltaSolver, AdamSolver
     15 import caffe.io

ImportError: /home/harshita/deep-learning/caffe/python/caffe/../../build/lib/libcaffe.so.1.0.0-rc3: undefined symbol: _ZN2cv8imencodeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKNS_11_InputArrayERSt6vectorIhSa....

I have no idea if this error is coming due to any installation problems.Help me out.

Levon
  • 138,105
  • 33
  • 200
  • 191
Harshita
  • 183
  • 1
  • 10
  • possible duplicate: http://stackoverflow.com/questions/30745647/python-interface-of-caffe-error-in-import-caffe . you can try sys.path.insert(0, CAFFE_HOME + '/python') *before* you import caffe – user1269942 Aug 13 '16 at 17:29

1 Answers1

0

Have you built pycaffe? Run make pycaffe in your caffe home folder.

By the way, your PATH is fine, otherwise you would receive an error like: no module named caffe.

Amir
  • 2,259
  • 1
  • 19
  • 29
  • yes i already made pycaffe.There was no error while installing it.How to fix something like this? – Harshita Aug 14 '16 at 08:55
  • Take a close look at this step by step guide on installing caffe on ubuntu: http://hanzratech.in/2015/07/27/installing-caffe-on-ubuntu.html. Make sure `make test` and `make runtest` are successfull. – Amir Aug 15 '16 at 16:54