我正在Ubuntu 18.04 LTS版本上安装caffe-cpu和anaconda。
无论如何,我成功在系统上安装了Anaconda,但是在安装caffe时遇到了麻烦。
我发现了很多页面,例如youtube,但是它没有帮助,因此我多次阅读了官方安装手册页面(I think here is the official page)。在此页面中,
Installing Caffe from source
We may install the dependencies by merely one line
sudo apt build-dep caffe-cpu # dependencies for CPU-only version
sudo apt build-dep caffe-cuda # dependencies for CUDA version
在您的sources.list中需要deb-src行。继续compliation
我不知道终点线的意思。我试图将/etc/apt/sources.list
修复为已禁用
'#'部分,但失败。我在互联网上找不到正确的方法。当我仅点击compliation链接时,他们说对Make或CMake表示满意。我也不知道该如何遵循这些信息。我发现了一些makefile.config Github page,但在我使用make all
命令时失败了。
您能给我一些建议来帮助安装caffe-cpu版本吗?感谢您阅读我的问题。
答案 0 :(得分:2)
我能够按照以下步骤进行操作,
获取CAFFE这里源形式(https://github.com/BVLC/caffe.git)
安装CUDA如果需要支持GPS(https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804)
安装CUDNN,如果需要支持GPS(https://developer.nvidia.com/rdp/cudnn-download)
替换现有Makefile.config与此(https://gist.github.com/GPrathap/1f9d184c55779509860b8bf92cea416d)在这里,我已配置CUDA 9.2。如果你有不同的版本,请搜索9.2和更改您已instaled版本。另外,请重新检查所有在Makefile.config声明的路径。
您可以键入make all
后跟make test
make distribute
,用于创建最终lib中,一个包括CAFFE其中可以找到的目录(CAFFE /分发)。
如果您正在使用的CMake型项目添加在哪里可以找到朱古力作为波纹管,
set(Caffe_DIR "/home/software/caffe/distribute")
set(Caffe_INCLUDE_DIRS "/home/software/caffe/distribute/include")
set(Caffe_LIBRARIES "/home/software/caffe/distribute/lib/libcaffe.so")
添加包含目录include_directories(${Caffe_INCLUDE_DIRS})
...添加库${Caffe_LIBRARIES}
如果你想拥有它建立适当增加PATH的另一种方式
答案 1 :(得分:0)
您可以在source.list中添加以下deb-src行:
deb http://ftp2.cn.debian.org/debian sid main contrib non-free
deb-src http://ftp2.cn.debian.org/debian sid main contrib non-free
如果您遇到一些公共密钥错误,这些命令将为您提供帮助。
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
答案 2 :(得分:0)
对于第一部分的问题,也就是官网建议的自动安装依赖,简单的应对方法如下:
1.在终端输入
software-properties-gtk
并在出现的窗口中确保选中源代码框。这会将重要的行添加到您的 sources.list 文件中。
sudo apt build-dep caffe-cpu # dependencies for CPU-only version
sudo apt build-dep caffe-cuda # dependencies for CUDA version
建议使用额外的 CLI 方法来添加行here(但是建议在 docker 映像中进行修改,这是有限制的,但可能会防止损坏系统文件)。