makefile - 在 ubuntu 18.04 LTS 上安装 caffe
问题描述
我在 Ubuntu 18.04 LTS 版本上安装 caffe-cpu 和 anaconda。
无论如何,我成功地在我的系统上安装了 Anaconda,但是我在安装 caffe 时遇到了麻烦。
我找到了很多页面,例如 youtube,但它没有帮助,所以我多次阅读官方安装手册页面(我认为这里是官方页面)。在这个页面中,
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 行。继续编译
我不知道结束线的意思。我试图修复/etc/apt/sources.list
为禁用
的 '#' 部分,但它失败了。我在互联网上找不到正确的方法。当我只是按照编译链接时,他们会说使用 Make 或 CMake 进行编译。我也不知道如何关注这些信息。我发现了一些makefile.config Github 页面make all
,当我使用命令时它失败了。
你能给我一些建议来帮助安装 caffe-cpu 版本吗?感谢您阅读我的问题。
解决方案
我能够按照这些步骤让它工作,
在此处获取 caffe 源表单 ( https://github.com/BVLC/caffe.git )
如果您需要 GPS 支持,请安装 CUDA ( https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1804 )
如果您需要 GPS 支持,请安装 CUDNN ( https://developer.nvidia.com/rdp/cudnn-download )
用这个替换现有的 Makefile.config ( https://gist.github.com/GPrathap/1f9d184c55779509860b8bf92cea416d ) 这里我已经为 cuda 9.2 配置了。如果您有不同的版本,请搜索 9.2 并更改您安装的版本。另外,请重新检查 Makefile.config 中声明的所有路径。
您可以键入
make all
后跟make test
make distribute
为了创建最终的库,一个包含目录的 caffe 可以在 (caffe/distribute) 中找到。如果您使用的是 CMake 类型的项目,请添加在哪里可以找到 caffe,如下所示,
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
推荐阅读
- python - 测试 pyqt 应用程序 - Qwidget:必须在 qwidget 之前构造一个 qapplication
- unit-testing - 模拟单元测试的 Vuex getter 会产生意想不到的结果
- marklogic - 摘要身份验证日志记录
- c# - 如何使用 .NET Standard 和 Entity Framework Core 为现有数据库创建 Entity Framework edmx 文件?
- django - 如何使用来自views.py的查询集过滤Django models.py中的对象
- node.js - 如何忽略嵌套的 NPM 依赖?
- ruby-on-rails - rails : 从模型中动态获取/设置 HTML5 字段中的复选框值
- mongodb - 无法整理出有关疯狂 MongoDB 内存使用的 *current* 信息
- python - python中eig到底输出了什么?
- java - 将 ComputationGraph 放在 JAR DL4j 的资源目录中