在windows/ubuntu下安装好caffe和Python并按步骤编译完成后,在终端中使用Python时遇到如下问题:
- Microsoft Windows [版本 6.1.7601]
- 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
- C:\Users\Lucifer>python
- Python 2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jun 29 2016, 11:07:13) [MSC v.
- 1500 64 bit (AMD64)] on win32
- Type "help", "copyright", "credits" or "license" for more information.
- Anaconda is brought to you by Continuum Analytics.
- Please check out: http://continuum.io/thanks and https://anaconda.org
- >>> import caffe
- ······
- ImportError: No module named google.protobuf.internal
这是由于缺少protobuf所致,解决办法:直接在终端下安装protobuf 即可:
- C:\Users\Lucifer>pip install protobuf
安装完成后,错误得到解决: