1. 程式人生 > >This program requires version 3.5.0 of the Protocol Buffer runtime library

This program requires version 3.5.0 of the Protocol Buffer runtime library

之前編譯一個github上的風格遷移的專案時遇到這個問題

This program requires version 3.5.0 of the Protocol Buffer runtime library, but the installed version is 3.0.0.  Please update your library.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "google/protobuf/descriptor.pb.cc".)

此程式需要的版本3.5.0的協議緩衝執行庫,但安裝的版本3.0.0。請更新您的庫。如果你自己編譯了這個程式,確保你的頭是來自同一版本的協議緩衝區,作為你的連結時間庫。(版本驗證失敗的“谷歌/ protobuf /描述符。鉛。CC”。)

主要是因為caffe編譯的時候預設的protobuf的版本是2.6.1,而Python通過pip install protobuf 安裝的版本是最新版本3.4.0!
而在caffe環境中我們必須統一ProtoBuffer的版本才可以避免各種不易排查的錯誤!! 
解決辦法:

sudo pip uninstall protobuf

然後再重新安裝:

sudo pip install protobuf==2.6.1