2017-07-06 64 views
0

我試圖訓練一個Caffe模型。我的.prototxt文件使用自定義的Python數據和丟失圖層。該程序需要協議緩衝區運行時庫的版本3.2.0,但安裝的版本是2.6.1

當我執行在終端的訓練命令,但是,這引發錯誤:

[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.2.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. 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".) 
terminate called after throwing an instance of 'google::protobuf::FatalException' 

我的Python包管理器(PIP)的安裝版本的protobuf的3.2.0,但系統版本爲2.6 .1爲一個名爲libprotoc的軟件包。我不確定如何指定pip protobuf版本是我想用於caffe的版本。

在另一臺安裝了pip和2.6.1版本的protobuf的計算機上安裝了系統版本,除了它說程序需要版本3.3.0而不是版本3.2之外,我被拋出了同樣的錯誤。 0。

最好。

+0

我們需要更多信息。你有多少種不同的Python版本?你使用虛擬環境嗎?這意味着什麼「我的Python包管理器(pip)安裝了protobuf版本3.2.0」?哪個python(如果你有更多的1 pythons)? – phd

+0

即時通訊運行在一個docker conrainer與python 2.7。然而在另一臺計算機上,我運行在Linux上,沒有虛擬容器,但仍然出現錯誤,所以我不相信thē錯誤必須處理該錯誤 –

回答

0

今天我遇到了完全相同的問題。對我來說,解決方法是從caffe的python界面開始訓練,而不是直接從shell啓動訓練。例如:

import caffe 

weights = '../ilsvrc-nets/vgg16-fcn.caffemodel' 
caffe.set_device(0) 
caffe.set_mode_gpu() 

solver = caffe.SGDSolver('solver.prototxt') 
solver.net.copy_from(weights) 

for _ in range(25): 
    solver.step(4000) 

當然,以上僅僅是一個例子/非常準系統,你必須處理對驗證運行自己設定,但pycaffe接口是相當靈活的,允許你做了這一切。你可以找到如何在這裏使用的詳細信息:

http://christopher5106.github.io/deep/learning/2015/09/04/Deep-learning-tutorial-on-Caffe-Technology.html

+0

感謝您的建議,我會在嘗試返回時給它一個提示在這裏工作並報告結果。 –

+0

沒有probs。順便說一下,如果你已經在解算器文件中設置了它,上面也將處理對測試集的運行(所以你不需要親自去做)。如果你實際上並不需要細粒度地控制for循環,那麼簡單的方法就是使用'solver.solve()'。 – Kosta

+0

Hi Kosta,你的解決方案也適用於我。非常感謝你! –

相關問題