Caffe installation in ubuntu 17.04: Import Error:

2019-08-19 09:17发布

问题:

After install caffe in conda virtual environment with Python 3.5

I am getting this error on importing caffe

Traceback (most recent call last): File "", line 1, in File "/var/caffe-master/python/caffe/init.py", line 1, in from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer File "/var/caffe-master/python/caffe/pycaffe.py", line 13, in from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \ ImportError: /usr/lib/libgdal.so.20: undefined symbol: sqlite3_column_table_name

I have installed Caffe for CPU only. Here is what i get when i echo $PYTHONPATH: /home/anaconda3/bin/caffe/python:

Please Help!!

回答1:

Here you can find instructions about how to safely uninstall anaconda from your system - Python Anaconda - How to Safely Uninstall.

Once you have successfully uninstalled anaconda you should be ready to install caffe.

In order to do this go to github.com/BVLC/caffe and download the repository somewhere on your system.

Then open a terminal, cd to the directory where you downloaded caffe repository and compile it with CMAKE.

Once the process is finished, you should be able to open Python and import caffe successfully.

Let me know if you solve the problem