Closed AliengirlLiv closed 6 years ago
I am not able to reproduce this so far. Are you using anaconda? What commands did you use to install caffe2?
I'm not using anaconda.
I installed caffe2 using the "MacOS X" instructions on this page using the "Brew and Pip Install Path" instructions.
Can you run
otool -L /usr/local/opt/glog/lib/libglog.0.dylib
otool -L /Users/cslaptop/Downloads/caffe2/build/caffe2/python/caffe2_pybind11_state.so
and also
find / -name libglog* 2>/dev/null
and paste the output here?
otool -L /usr/local/opt/glog/lib/libglog.0.dylib
/usr/local/opt/glog/lib/libglog.0.dylib:
/usr/local/opt/glog/lib/libglog.0.3.5.dylib (compatibility version 0.3.5, current version 0.0.0)
/usr/local/opt/gflags/lib/libgflags.2.2.dylib (compatibility version 2.2.0, current version 2.2.1)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
otool -L /Users/cslaptop/Downloads/caffe2/build/caffe2/python/caffe2_pybind11_state.so
/Users/cslaptop/Downloads/caffe2/build/caffe2/python/caffe2_pybind11_state.so:
/Users/cslaptop/Downloads/caffe2/build/lib/libcaffe2.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/libprotobuf.14.dylib (compatibility version 15.0.0, current version 15.0.0)
/usr/local/opt/gflags/lib/libgflags.2.2.dylib (compatibility version 2.2.0, current version 2.2.0)
/usr/local/opt/glog/lib/libglog.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/lmdb/lib/liblmdb.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/leveldb/lib/libleveldb.1.20.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/local/opt/snappy/lib/libsnappy.1.dylib (compatibility version 5.0.0, current version 5.1.0)
/usr/local/opt/opencv/lib/libopencv_highgui.2.4.dylib (compatibility version 2.4.0, current version 2.4.13)
/usr/local/opt/opencv/lib/libopencv_imgproc.2.4.dylib (compatibility version 2.4.0, current version 2.4.13)
/usr/local/opt/opencv/lib/libopencv_core.2.4.dylib (compatibility version 2.4.0, current version 2.4.13)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
find / -name libglog* 2>/dev/null
/Users/cslaptop/Documents/Coding/AICamera/app/src/main/jniLibs/armeabi-v7a/libglog.so
/Users/cslaptop/Documents/Coding/MobileApp/node_modules/react-native/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/libglog.so
/Users/cslaptop/Documents/Coding/MobileApp/node_modules/react-native/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/libglog_init.so
/Users/cslaptop/Documents/Coding/MobileApp/node_modules/react-native/ReactAndroid/src/main/jni/prebuilt/lib/x86/libglog.so
/Users/cslaptop/Documents/Coding/MobileApp/node_modules/react-native/ReactAndroid/src/main/jni/prebuilt/lib/x86/libglog_init.so
/Users/cslaptop/Library/Caches/Homebrew/glog--git/libglog.pc.in
/Users/cslaptop/miniconda3/envs/python2/lib/libglog.0.dylib
/Users/cslaptop/miniconda3/envs/python2/lib/libglog.a
/Users/cslaptop/miniconda3/envs/python2/lib/libglog.dylib
/Users/cslaptop/miniconda3/envs/python2/lib/libglog.la
/Users/cslaptop/miniconda3/envs/python2/lib/pkgconfig/libglog.pc
/Users/cslaptop/miniconda3/pkgs/glog-0.3.5-0/lib/libglog.0.dylib
/Users/cslaptop/miniconda3/pkgs/glog-0.3.5-0/lib/libglog.a
/Users/cslaptop/miniconda3/pkgs/glog-0.3.5-0/lib/libglog.dylib
/Users/cslaptop/miniconda3/pkgs/glog-0.3.5-0/lib/libglog.la
/Users/cslaptop/miniconda3/pkgs/glog-0.3.5-0/lib/pkgconfig/libglog.pc
/usr/local/Cellar/glog/0.3.5_3/lib/libglog.0.3.5.dylib
/usr/local/Cellar/glog/0.3.5_3/lib/libglog.0.dylib
/usr/local/Cellar/glog/0.3.5_3/lib/libglog.dylib
/usr/local/Cellar/glog/0.3.5_3/lib/pkgconfig/libglog.pc
/usr/local/lib/libglog.0.3.5.dylib
/usr/local/lib/libglog.0.dylib
/usr/local/lib/libglog.dylib
/usr/local/lib/pkgconfig/libglog.pc
As a note, I'm surprised to see miniconda directories here, since I uninstalled miniconda a while ago. Is it possible that's somehow related to the error?
If you echo $PATH
and miniconda isn't it, then this miniconda installation is not related to your problem.
As an aside, Miniconda is uninstalled by manually removing the miniconda directory, like sudo rm -rf ~/miniconda3
, and then by removing 'miniconda' from your $PATH (if you echo $PATH
and miniconda is still in it somwhere, then check your ~/.bashrc
and ~/.bash_profile
files for a line that looks like export PATH=<miniconda somewhere in here>
and delete it, then reopen all of your terminal windows).
Uninstalling your miniconda and building again might help. Uninstalling glog with brew and reinstalling with pip might help too (brew uninstall -y glog && pip install glog
), but I'm not really sure what's going on here yet. I don't see any problems in the output you posted. @orionr do you know what's happening here?
Could you also paste the output for
brew list glog
and
pip freeze
?
Also, if you don't care about glog and just want to get Caffe2 running then you can just turn glog off by passing -DUSE_GLOG=OFF
to cmake
Thanks for the suggestions! After deleting the miniconda directory, uninstalling glog with brew and reinstalling it with pip, I stop getting the glog error, but when I try to import caffe2 in python I instead get the error
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "caffe2/python/core.py", line 29, in <module>
from caffe2.proto import caffe2_pb2
ImportError: cannot import name caffe2_pb2
Here are the outputs of the commands you requested:
brew list glog
Error: No such keg: /usr/local/Cellar/glog
pip freeze
altgraph==0.10.2
appdirs==1.4.3
appnope==0.1.0
backports.shutil-get-terminal-size==1.0.0
bdist-mpkg==0.5.0
bonjour-py==0.3
certifi==2017.4.17
chardet==3.0.4
click==6.7
decorator==4.1.2
enum34==1.1.6
Flask==0.12.2
future==0.16.0
glog==0.3.1
httpie==0.9.9
idna==2.5
ipython==5.5.0
ipython-genutils==0.2.0
itsdangerous==0.24
Jinja2==2.9.6
macholib==1.5.1
MarkupSafe==1.0
matplotlib==1.3.1
modulegraph==0.10.4
nbdiff==1.0.3
numpy==1.8.0rc1
olefile==0.44
packaging==16.8
pathlib2==2.3.0
pexpect==4.2.1
pickleshare==0.7.4
Pillow==4.3.0
prompt-toolkit==1.0.15
protobuf==3.5.1
ptyprocess==0.5.2
py2app==0.7.3
Pygments==2.2.0
pyobjc-core==2.5.1
pyobjc-framework-Accounts==2.5.1
pyobjc-framework-AddressBook==2.5.1
pyobjc-framework-AppleScriptKit==2.5.1
pyobjc-framework-AppleScriptObjC==2.5.1
pyobjc-framework-Automator==2.5.1
pyobjc-framework-CFNetwork==2.5.1
pyobjc-framework-Cocoa==2.5.1
pyobjc-framework-Collaboration==2.5.1
pyobjc-framework-CoreData==2.5.1
pyobjc-framework-CoreLocation==2.5.1
pyobjc-framework-CoreText==2.5.1
pyobjc-framework-DictionaryServices==2.5.1
pyobjc-framework-EventKit==2.5.1
pyobjc-framework-ExceptionHandling==2.5.1
pyobjc-framework-FSEvents==2.5.1
pyobjc-framework-InputMethodKit==2.5.1
pyobjc-framework-InstallerPlugins==2.5.1
pyobjc-framework-InstantMessage==2.5.1
pyobjc-framework-LatentSemanticMapping==2.5.1
pyobjc-framework-LaunchServices==2.5.1
pyobjc-framework-Message==2.5.1
pyobjc-framework-OpenDirectory==2.5.1
pyobjc-framework-PreferencePanes==2.5.1
pyobjc-framework-PubSub==2.5.1
pyobjc-framework-QTKit==2.5.1
pyobjc-framework-Quartz==2.5.1
pyobjc-framework-ScreenSaver==2.5.1
pyobjc-framework-ScriptingBridge==2.5.1
pyobjc-framework-SearchKit==2.5.1
pyobjc-framework-ServiceManagement==2.5.1
pyobjc-framework-Social==2.5.1
pyobjc-framework-SyncServices==2.5.1
pyobjc-framework-SystemConfiguration==2.5.1
pyobjc-framework-WebKit==2.5.1
pyOpenSSL==0.13.1
pyparsing==2.0.1
python-dateutil==1.5
python-gflags==3.1.2
python-Levenshtein==0.12.0
pytz==2013.7
requests==2.18.1
scandir==1.6
scipy==0.13.0b1
selenium==3.4.3
simplegeneric==0.8.1
six==1.4.1
traitlets==4.3.2
urllib3==1.21.1
virtualenv==15.1.0
wcwidth==0.1.7
Werkzeug==0.12.2
xattr==0.6.4
zope.interface==4.1.1
Since the original issue is fixed, I will close this. Please open a new issue with the new problem (can't find caffe2_pb2).
Okay, so my best guess is that the latest Caffe2 build picked up cached / already-installed binaries that are left over from a previous failed Caffe2 build (which picked up binaries from miniconda). Please delete all the old build stuffs; if you're using the pip and brew instructions then these are probably 1) caffe2/build
directory that you created during the installation instructions and 2) /usr/local/caffe2
and /usr/local/caffe
(unless you manually changed CMAKE_INSTALL_PREFIX to something other than /usr/local
). Please delete all of these folders, then rebuild (starting from the mkdir build && cd build
).
This might be related to protobuf now, so https://caffe2.ai/docs/getting-started.html?platform=mac&configuration=compile#null__protobuf-errors and https://caffe2.ai/docs/getting-started.html?platform=mac&configuration=compile#null__general-debugging-tips might be useful to you.
If the problem persists after a clean build, please paste the full output from the cmake
command that you ran.
I installed caffe2 without any errors, but when I tried to import caffe2 in python, I get this error:
However, glog does not have 1.0.0 version - 0.3.5 appears to be the most recent version.
System information
CMake summary output