ubuntu18.04如何安装caffe-cpu以及添加到pycharm中

  • Post author:
  • Post category:其他


1.更换国内源

cd /etc/apt

sudo cp /etc/apt/source.list /etc/apt/source.list.bak





2)更换阿里源

sudo gedit /etc/apt/source.list(不会用vim)

3)删除原来内容,添加以下内容

deb http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiversedeb

http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiversedeb

http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiversedeb

http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiversedeb

http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiversedeb-src

http://mirrors.aliyun.com/ubuntu/ vivid main restricted universe multiversedeb-src

http://mirrors.aliyun.com/ubuntu/ vivid-security main restricted universe multiversedeb-src

http://mirrors.aliyun.com/ubuntu/ vivid-updates main restricted universe multiversedeb-src

http://mirrors.aliyun.com/ubuntu/ vivid-proposed main restricted universe multiversedeb-src

http://mirrors.aliyun.com/ubuntu/ vivid-backports main restricted universe multiverse

4)运行sudo apt-get update 和sudo apt-get upgrade

2   安装caffe

sudo apt install caffe-cpu

3。检测  python3

import caffe

4。添加路径到pycharm中

打开配置文件



sudo gedit ~/.bashrc

在文件最下面写入(导入caffe/python文件夹的路径):



export


PYTHONPATH=usr/bin


/caffe


:$PYTHONPATH

使环境变量生效:



source


~/.bashrc




版权声明:本文为qq_25745703原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。