c++ - 编译 Caffe C++ 分类示例

标签 c++ machine-learning neural-network deep-learning caffe

我最近修改了 Caffe C++ classification example file我正在尝试重新编译它。但是,我无法将简单的 g++ 编译链接到 include 目录中的 .hpp 文件。我知道这是一个基本问题,但我似乎无法解决 - 有人可以帮我解决如何编译这个程序吗?编译现在看起来像这样:

g++ -I /home/jack/caffe/include classification.cpp -o classify

但是我收到了这个错误:

In file included from /home/jack/caffe/include/caffe/common.hpp:19:0,
    from /home/jack/caffe/include/caffe/blob.hpp:8,
    from /home/jack/caffe/include/caffe/caffe.hpp:7,
    from classification.cpp:1:
/home/jack/caffe/include/caffe/util/device_alternate.hpp:34:23: fatal error: cublas_v2.h: No such file or directory
 #include <cublas_v2.h>

我在没有 Nvidia GPU 的机器上运行它,所以当我查看 device_alternate.hpp 文件时,我意识到它调用了很多与 cuda 相关的 .hpp 文件,这些文件并不存在。

最佳答案

通常,为了帮助编译器定位头文件,您需要添加-I /path/to/include/folder。编译行的选项:

~$ g++ -I /path/to/caffe/include myfile.cpp

关于c++ - 编译 Caffe C++ 分类示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32218466/

相关文章:

C++ vector 排序

c++ - 采用可选且无参数的重载方法 : why no ambiguity?

machine-learning - 如何在Azure机器学习中构建卷积神经网络?

machine-learning - 截止点 1 处的随机森林

machine-learning - 求卷积后矩阵大小的公式

c++ - 在 C++ 中,我可以在定义自己的复制构造函数后跳过定义赋值运算符吗?

C++ - 编译时出错

python - 连续 3 维变量的离散化

artificial-intelligence - 神经网络推荐引擎

受限玻尔兹曼机和深度学习的 Java 代码