Repository: pytorch
Issue: caffe2 Segmentation fault (core dumped)
Labels: caffe2

I compile caffe2 from source(pytorch) by anaconda3.

operations:
In the pytorch directory,I
 mkdir build && cd build  
cmake -DCMAKE_PREFIX_PATH=/home/zhengr/.conda/envs/caffe2-source -DCMAKE_INSTALL_PREFIX=/home/zhengr/.conda/envs/caffe2-source ..
sudo make install -j8

there is no error by then.

[100%] Built target caffe2_detectron_ops_gpu
Install the project...
-- Install configuration: "Release"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/bin/protoc" to "$ORIGIN"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/libonnxifi_dummy.so" to "$ORIGIN"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/libonnxifi.so" to "$ORIGIN"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/libfoxi_dummy.so" to "$ORIGIN"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/libfoxi.so" to "$ORIGIN"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/libc10.so" to "$ORIGIN"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/libc10_cuda.so" to "$ORIGIN:/usr/local/cuda/lib64"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/libcaffe2.so" to "$ORIGIN:/usr/lib/openmpi/lib:/home/zhengr/.conda/envs/caffe2-source/lib:/usr/local/cuda/lib64"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/libcaffe2_gpu.so" to "$ORIGIN:/usr/local/cuda/lib64:/home/zhengr/.conda/envs/caffe2-source/lib:/usr/lib/openmpi/lib"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/python2.7/site-packages/caffe2/python/caffe2_pybind11_state.so" to "$ORIGIN:/home/zhengr/.conda/envs/caffe2-source/lib"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/python2.7/site-packages/caffe2/python/caffe2_pybind11_state_gpu.so" to "$ORIGIN:/usr/local/cuda/lib64:/home/zhengr/.conda/envs/caffe2-source/lib"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/libcaffe2_detectron_ops_gpu.so" to "$ORIGIN:/usr/local/cuda/lib64:/home/zhengr/.conda/envs/caffe2-source/lib"
-- Set runtime path of "/home/zhengr/.conda/envs/caffe2-source/lib/libcaffe2_observers.so" to "$ORIGIN:/home/zhengr/.conda/envs/caffe2-source/lib"

when i test "from caffe2.python import core" in python, when in different dictories, I got
(caffe2-source) zhengr@zhengr-ThinkStation-P318:~/data/projects/caffe2-source$ python
Python 2.7.15 | packaged by conda-forge | (default, Feb 28 2019, 04:00:11) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from caffe2.python import core
WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode.
Segmentation fault (core dumped)

(caffe2-source) zhengr@zhengr-ThinkStation-P318:~/data/projects/caffe2-source/pytorch$ python
Python 2.7.15 | packaged by conda-forge | (default, Feb 28 2019, 04:00:11) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from caffe2.python import core
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "caffe2/python/__init__.py", line 2, in <module>
    from caffe2.proto import caffe2_pb2
ImportError: cannot import name caffe2_pb2

"Segmentation fault (core dumped)" is the problem I think.

more information:
/usr/local/lib/libboost_random.so.1.62.0
gcc (Ubuntu 4.9.3-13ubuntu2) 4.9.3


what shoud I do? can anyone help me?