2

I've compiled the Caffe framework (caffe.berkeleyvision.org) successfully by running

make all
make pycaffe

However, when I try to load up the library I am getting a weird error:

In [1]: import sys

In [2]: sys.path.append('/contrib/projects/caffe/caffe/python')

In [3]: import caffe
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-3-1cca3aa1f8c5> in <module>()
----> 1 import caffe

/contrib/projects/caffe/caffe/python/caffe/__init__.py in <module>()
----> 1 from .pycaffe import Net, SGDSolver
      2 from .classifier import Classifier
      3 from .detector import Detector
      4 import io

/contrib/projects/caffe/caffe/python/caffe/pycaffe.py in <module>()
      8 import numpy as np
      9 
---> 10 from ._caffe import Net, SGDSolver
     11 import caffe.io
     12 

ImportError: /usr/lib/libboost_python-py27.so.1.49.0: undefined symbol: PyUnicodeUCS4_AsWideChar

Do I need to re-compile my python distribution with certain flags?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
ejang
  • 3,982
  • 8
  • 44
  • 70

1 Answers1

0

You are trying to run an extension compiled for a UCS4 (wide Unicode) build with a UCS2 Python.

Either recompile the extension or install a UCS4 Python build. See How to change python from UCS2 to UCS4

Community
  • 1
  • 1
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343