简体   繁体   English

OS X上的MXNet ML lib C ++分段错误

[英]MXNet ML lib C++ segmentation fault on OS X

I have a problem with Apache MXNet machine learning library on OS X. 我在OS X上有Apache MXNet机器学习库的问题。

I have been able to run Python version of Lenet, convolutional neural network. 我已经能够运行Python版本的Lenet,卷积神经网络。 I installed these with pip under both Anaconda Python 2.7 and 3.6. 我在Anaconda Python 2.7和3.6下通过pip安装了这些工具。

conda create -n mxnet27 python=2.7
conda info --envs
source activate mxnet27
conda list
pip install mxnet==0.12.1

But when I run C++ example files cpp-package/example/lenet.cpp I get the this segfault: 但是当我运行C ++示例文件cpp-package / example / lenet.cpp时,我得到了以下段错误:

Segmentation fault: 11

This is the place in the code where the segfault is thrown: 这是在代码中引发段错误的位置:

Symbol conv1 =
    Convolution("conv1", data, conv1_w, conv1_b, Shape(5, 5), 20);

I get similar segfault for the other C++ examples. 对于其他C ++示例,我也会遇到类似的段错误。

I have built MXNet on OS X 10.13.2 I disabled as many libraries as possible, eg OpenCV and CUDA. 我已经在OS X 10.13.2上构建了MXNet,我禁用了尽可能多的库,例如OpenCV和CUDA。

On Simon Corston-Oliver suggestion I upgraded to MXNet 1.0.0, but that version did not compile with Clang on OS X. Error message: 关于Simon Corston-Oliver的建议,我已升级到MXNet 1.0.0,但该版本未在OS X上与Clang一起编译。错误消息:

operator_tune.h:150:36: note: add an explicit instantiation declaration to suppress this
      warning if 'mxnet::op::OperatorTuneByType<float>::tuning_mode_' is explicitly instantiated in another translation unit

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/unordered_map:601:15: error: object of type 'std::__1::pair<int,
  mxnet::test::perf::TimingInstrument::Info>' cannot be assigned because its copy assignment operator is implicitly deleted

I don't know of a specific issue with v0.12 that would lead to a segfault but before we dig in, I'd recommend upgrading to v1.0 which was released 2017-12-04. 我不知道v0.12的特定问题会导致段错误,但在深入探讨之前,我建议升级到2017年12月4日发布的v1.0。

If you still encounter the same problem with 1.0 we can work to debug. 如果您在1.0中仍然遇到相同的问题,我们可以进行调试。

I found a solution to compiling MXNet 1.0.0 posted here by helloniklas: 我找到了编译helloniklas在此处发布的MXNet 1.0.0的解决方案:

https://github.com/apache/incubator-mxnet/issues/9217 https://github.com/apache/incubator-mxnet/issues/9217

It involved only using make instead of CMake . 它只涉及使用make而不是CMake

This solution worked me and compiled the code. 这个解决方案使我工作并编译了代码。

C++ examples runs without the seg fault, but documentation is scarce. C ++示例运行时没有seg错误,但是文档很少。 I only got one of the to do training. 我只有其中一个要做培训。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM