0

I have a problem with Apache MXNet machine learning library on OS X.

I have been able to run Python version of Lenet, convolutional neural network. I installed these with pip under both Anaconda Python 2.7 and 3.6.

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:

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.

I have built MXNet on OS X 10.13.2 I disabled as many libraries as possible, e.g. OpenCV and 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:

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
Sami Badawi
  • 977
  • 1
  • 10
  • 22
  • Glad to hear you were able to install. Pip install without specifying version should default to v1.0 if you don't need anything unusual for the build. That would spare you having to compile from source. – Simon Corston-Oliver Jan 16 '18 at 15:39

2 Answers2

1

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.

If you still encounter the same problem with 1.0 we can work to debug.

  • Thanks I am trying this. My Clang compiler has gotten very slow after Meltdown and Spectre security patches. – Sami Badawi Jan 15 '18 at 12:46
  • I got a compile error compiling 1.0.0 with Clang on OS X: deeplearning/mxnet/nnvm/include/../../src/operator/./operator_tune.h:150:36: note: add an explicit instantiation declaration to suppress this warning if 'mxnet::op::OperatorTuneByType::tuning_mode_' is explicitly instantiated in another translation unit v1/unordered_map:601:15: error: object of type 'std::__1::pair' cannot be assigned because its copy assignment operator is implicitly deleted – Sami Badawi Jan 15 '18 at 18:45
1

I found a solution to compiling MXNet 1.0.0 posted here by helloniklas:

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

It involved only using make instead of CMake.

This solution worked me and compiled the code.

C++ examples runs without the seg fault, but documentation is scarce. I only got one of the to do training.

Sami Badawi
  • 977
  • 1
  • 10
  • 22