python - OSX Caffe 编译失败,出现预期的表达式错误

标签 python macos machine-learning caffe

我一直在尝试在运行 OSX 10.13.6 的 mac 上安装 Caffe

我遵循了几个指南,包括 caffe 站点上的安装指南。我已经删除了所有内容并重新启动了几次。无论如何我都会遇到同样的问题。当我去编译所有东西时,我得到了这个

Scanning dependencies of target caffeproto [ 1%] Building CXX object src/caffe/CMakeFiles/caffeproto.dir/__/__/include/caffe/proto/caffe.pb.cc.o In file included from /Users/Name/Documents/Programming/PythonEnv/caffe/build/include/caffe/proto/caffe.pb.cc:4: In file included from /Users/Name/Documents/Programming/PythonEnv/caffe/build/include/caffe/proto/caffe.pb.h:9: /usr/local/include/google/protobuf/stubs/common.h:209:17: error: expected expression OnShutdownRun([](const void* p) { delete static_cast<const T*>(p); }, p); ^ In file included from /Users/Name/Documents/Programming/PythonEnv/caffe/build/include/caffe/proto/caffe.pb.cc:4: In file included from /Users/Name/Documents/Programming/PythonEnv/caffe/build/include/caffe/proto/caffe.pb.h:25: In file included from /usr/local/include/google/protobuf/generated_message_table_driven.h:34: In file included from /usr/local/include/google/protobuf/map.h:49: In file included from /usr/local/include/google/protobuf/map_type_handler.h:35: In file included from /usr/local/include/google/protobuf/wire_format_lite_inl.h:43: /usr/local/include/google/protobuf/message_lite.h:117:3: error: unknown type name 'constexpr' constexpr const T& get() const { return reinterpret_cast<const T&>(union_); }

我也尝试过使用 CMake 并遇到了同样的问题。我不确定从这里去哪里。我对构建流程并不是非常了解,所以如果这含糊不清,我深表歉意,并且很乐意提供任何其他可能有助于解决此问题的信息。

谢谢!

最佳答案

如果使用make编译,修改Makefile如下:

- CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS)

+ CXXFLAGS += -pthread -fPIC $(COMMON_FLAGS) $(WARNINGS) -std=c++11

关于python - OSX Caffe 编译失败,出现预期的表达式错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52728417/

相关文章:

python - 在多索引 DataFrame 中随机采样级别

python - 为什么我的 socket 不工作?

ios - ld : framework not found FileProvider for architecture x86_64 in Xcode 8. 3.2

ios - 将 block 并发插入并发队列

php - 日志文件与数据库在哪里保存用户事件数据以供分析?

python - 从 heapq python 弹出最大值,Python 中有最大堆吗?

python - 有没有办法检查 NumPy 数组是否共享相同的数据?

python - 查找 Homebrew 安装的 Python 路径

command-line - 在命令行上导出 weka 结果

python-2.7 - 父树 : Expected a node value and child list or a single string or 'ParentedTree' object has no attribute 'label'