在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
安裝完成後,錯誤得到解決: