2

I'm trying to run Caffe in it's Python interface. I've already run the command make pycaffe in the caffe directory and it worked fine. Now, when I run the command import caffe in the python environment in the terminal (Ubuntu 14.04), I'm getting the following error:

    >>> import caffe
    Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "/home/pras/caffe/python/caffe/__init__.py", line 1, in <module>
      from .pycaffe import Net, SGDSolver
     File "/home/pras/caffe/python/caffe/pycaffe.py", line 11, in <module>
      import caffe.io
    ImportError: No module named io

I tried to search my computer for 'caffe.io' but couldn't find any file by that name. Any idea why this error is occurring and how to correct it?

Dr. Prasanna Date
  • 745
  • 1
  • 9
  • 29
  • you need to look for file io.py in caffe folder – Shai Jun 10 '15 at 13:45
  • Thanks Shai. Found the file in caffe folder and it seems to be working now! – Dr. Prasanna Date Jun 11 '15 at 15:13
  • I'm having issues with creating a LMDB data file to be run with Caffe though. [Here](http://stackoverflow.com/questions/30769048/error-in-creating-lmdb-database-file-in-python-for-caffe) is the link to the question. Please have a look. – Dr. Prasanna Date Jun 11 '15 at 15:27

1 Answers1

6

You need to add Python Caffe to PYTHONPATH. In your case:
export PYTHONPATH=$PYTHONPATH:/home/pras/caffe/python

LiberiFatali
  • 185
  • 11