Issues with pycaffe - illegal hardware instruction, crash when 'import caffe'

393 views
Skip to first unread message

agust...@gmail.com

unread,
Sep 27, 2016, 5:23:26 PM9/27/16
to Caffe Users
I was able to successfully compile caffe for CPU only. I am currently on a MacBook Pro running macOS Sierra. I ran make all, make test, make run test, make pycaffe. When I run import caffe in python interpreter, I see the following:

>>> import caffe
Python(14990,0x7fffc23a93c0) malloc: *** malloc_zone_unregister() failed for 0x7fffc239f000
/usr/local/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
[1]    14990 illegal hardware instruction  python

I ran ran python in verbose mode and I see the malloc fail here:

dlopen("caffe/_caffe.so", 2);
Python(13066,0x7fffc23a93c0) malloc: *** malloc_zone_unregister() failed for 0x7fffc239f000
import caffe._caffe # dynamically loaded from caffe/_caffe.so

I am not very sure what might be going wrong. My Python include and path directories seem to be correct after referring to multiple online tutorials

PYTHON_INCLUDE := /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/include/python2.7/ \
/usr/local/lib/python2.7/site-packages/numpy/core/include/

PYTHON_LIB := /usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib

Is there a way to isolate the problem and fix? 

agust...@gmail.com

unread,
Sep 28, 2016, 12:14:21 PM9/28/16
to Caffe Users
Additional note to my post
I think that somehow my 'make all' itself doesn't go well. I see these messages:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_conv_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_lcn_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_lrn_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_pooling_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_relu_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_sigmoid_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_softmax_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn_tanh_layer.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: .build_release/lib/libcaffe.a(cudnn.o) has no symbols

Should these messages not pop up?

iamlegolas

unread,
Oct 1, 2016, 3:07:27 PM10/1/16
to Caffe Users
Hello!

I get the exact same error while trying to import caffe. So far I haven't been able to find any solution. I use the python shell in the following folder: caffe/python. I think this is because of some incompatibility with MacOS Sierra. :|

Somebody please help.

iamlegolas

unread,
Oct 1, 2016, 3:09:28 PM10/1/16
to Caffe Users
This is the error I get, to be exact:

Python(43019,0x7fff9f14c3c0) malloc: *** malloc_zone_unregister() failed for 0x7fff9f142000


/usr/local/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')

Illegal instruction: 4

agust...@gmail.com

unread,
Oct 1, 2016, 5:47:39 PM10/1/16
to Caffe Users
I opened an issue on github too, a few others have been facing this. Waiting for someone who understands inner workings of Caffe to help!
Reply all
Reply to author
Forward
0 new messages