Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation Fault: 11 - OSX high sierra - please Help #6019

Open
Dinuz opened this issue Nov 1, 2017 · 10 comments
Open

Segmentation Fault: 11 - OSX high sierra - please Help #6019

Dinuz opened this issue Nov 1, 2017 · 10 comments
Labels

Comments

@Dinuz
Copy link

Dinuz commented Nov 1, 2017

Hello guys, please help me in understanding what is going on and why. Are 3 days that I am trying desperately to let this work without success.
Please help me!
Thank you so very much.

Issue summary

After complete successfully the caffe installation (No difference using make or cmake), make all, make test and make runtest without any error(all test passed); I launched python in a shell, and called import caffe and I got segmentation fault 11.

I run all in an anaconda environment with python 3.6.3 and all the requirements installed by conda in the environment.

I use brew to install proto boost and boost-python (—with-python3 —without-python -built-from-source) and cv2 and all the other dependence (as in the installation notes).

The installation is only_cpu . The python path is set as the anaconda envs path (cmakecahe).

Everything works fine except the import caffe in python, that gives segmentation fault 11.

Steps to reproduce

Finish the make runtest, run make pycaffe, export caffe/python path, run python shell, run import caffe

If you are having difficulty building Caffe or training a model, please ask the caffe-users mailing list. If you are reporting a build error that seems to be due to a bug in Caffe, please attach your build configuration (either Makefile.config or CMakeCache.txt) and the output of the make (or cmake) command.

Your system configuration

Operating system: osx high Sierra 10.13
Compiler:
CUDA version (if applicable):
CUDNN version (if applicable):
BLAS:
Python or MATLAB version (for pycaffe and matcaffe respectively): python 3.6.3 coming with anaconda

@shuguang101
Copy link

I met this problem too, I trying several method to fix the problem, but failed. Who can help me, thank you so very much. The lldb debug information are as flows: (boost version: 1.65.1)

(lldb) target create "python3"
Current executable set to 'python3' (x86_64).
(lldb) r
Process 5016 launched: '/Users/mq/anaconda3/bin/python3' (x86_64)
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 6 2017, 12:04:38)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import caffe
Process 5016 stopped

@Noiredd Noiredd added the mac label Mar 2, 2018
@c9s
Copy link

c9s commented Jul 26, 2018

Same here, this is not just for OS X. It also happens in Linux Conda + Caffe

@CarlosRDomin
Copy link

CarlosRDomin commented Sep 26, 2018

Same here, anyone has found a solution?

I'm on Python 3.7 in a conda environment (Mac OS X 10.13.6)

@c9s
Copy link

c9s commented Sep 26, 2018

You can try ipython, it has a dynamic loader that solves the failed dynamic linking

@c9s
Copy link

c9s commented Sep 26, 2018

I remember the cause is related to the boost python library

@CarlosRDomin
Copy link

Hmmm it's weird. Everything works well on Anaconda's Python 2.7, only get Segmentation Fault: 11 on Anaconda's Python 3 (tried 3.7 and 3.6, with the exact same environment setup as the Python 2.7 that works)

@CarlosRDomin
Copy link

FYI, after a lot of tinkering, I was able to compile Caffe in Python 3 without getting the traditional segmentation fault!! 🎉
The key was to use Homebrew + Python 3's venv instead of conda. Full instructions can be found here. I know it's an old thread but hope it can be of any help! :)

@huihuili2019
Copy link

@Dinuz same with you . did you solved ?

@shuguang101
Copy link

shuguang101 commented May 9, 2020 via email

@huihuili2019
Copy link

I probably found the cause of this problem!
It should be a problem with the python3 library under the conda environment

Under the same thirdparty conditions, change the python version :

  • conda create -n python27 python = 2.7
  • conda activate python27
  • then recompile caffe in current environment
  • and don't forget pip install -r requirement.txt in caffe_bvlc/python
  • then import caffe successfully

Although the question has been raised for a long time, I still hope to help others.

This problem has troubled me for a long time, I tested the runtime environment in detail, and finally located it may be the reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants