【近期服務器環境配置上的問題】

【問題1】libcaffe.so.1.0.0: undefined symbol: _ZN6google4base21CheckOpMessageBuilder9NewStringB5cxx11Ev

  1. Ref.1
  2. Ref.2
  3. 將環境變量中的protoc問題解決後這個問題就沒有了

【問題2】This program requires version 3.6.1 of the Protocol Buffer runtime li, but the installed version is 2.6.1.

(caffe) jigepeng@user-SYS-7048GR-TR:~/Downloads/protobuf-3.2.0$ protoc
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.6.1 of the Protocol Buffer runtime li, but the installed version is 2.6.1.  Please update your library.  If you compiled the program yourself, make sure that youders are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "google/protony.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  This program requires version 3.6.1 of the Protocol Buffer runtime library, but the installed version is 2.6.1.  e update your library.  If you compiled the program yourself, make sure that your headers are from the same version of Protouffers as your link-time library.  (Version verification failed in "google/protobuf/any.pb.cc".)
Aborted (core dumped)

如何解決:

# 首先你得卸載ubuntu中的protobuf 2.6.1版本(當然你也可以共存安裝,詳情百度)
# 然後你安裝一個protobuf 3.6.1版本,發現還是有如上的問題,解決了一下午後,發現是自己的環境變量的問題
$ sudo gedit ~/.profile
# 修改如下內容
# export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libprotobuf.so.9
# 爲
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
# 不指定libprotobuf的路徑就可以解決了
# 完事了source更新一下
source ~/.profile
# 然後就可以測試protoc是否安裝成功
$ protoc --version
# 查看protoc的版本無誤,就說明安裝成功了

【問題3】caffe重新編譯的問題

【問題3.1】TypeError: init() got an unexpected keyword argument ‘syntax’

多版本protobuf安裝問題
如何卸載protobuf

# 在import caffe後發現如上問題
$ conda uninstall protobuf	# 發現失敗可以直接安裝新的protobuf
# 建議這些操作都是在虛擬環境下進行的,不然會與ubuntu系統本身的發生不可描述的衝突
# 每個人的電腦環境不一致,不能保證一定成功
# 創建虛擬環境命令如下:conda create [env name] python=3.x/2.x
conda install protobuf=3.6.1
# 安裝成功後邊可以解決

【問題3.2】no module named pywt

參考:pyWavelets工具包的安裝及使用

conda install pywavelets

【問題3.3】caffe與tensorflow共存的問題

事實證明,在protoc=3.6.1和python=2.7版本下,caffe與tensorflow可以共存
在這裏插入圖片描述
後續會安裝python3.x版本的tensorflow與caffe共存的環境
參考這篇

【問題3.4】no module named cv2

在系統中安裝python-opencv方法如下:
Ref
在conda中安裝python-opencv方法如下:

(caffe) jigepeng@user-SYS-7048GR-TR:~$ conda install -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64 opencv
Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: /home/jigepeng/.conda/envs/caffe

  added / updated specs:
    - opencv


The following NEW packages will be INSTALLED:

  hdf5               anaconda/pkgs/free/linux-64::hdf5-1.8.17-2
  jbig               anaconda/pkgs/free/linux-64::jbig-2.1-0
  jpeg               anaconda/pkgs/free/linux-64::jpeg-8d-2
  libpng             anaconda/pkgs/free/linux-64::libpng-1.6.30-1
  libtiff            anaconda/pkgs/free/linux-64::libtiff-4.0.6-2
  opencv             anaconda/pkgs/free/linux-64::opencv-3.1.0-np112py27_1

The following packages will be DOWNGRADED:

  numpy                                       1.13.1-py27_0 --> 1.12.1-py27_0
  pywavelets                              0.5.2-np113py27_0 --> 0.5.2-np112py27_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

效果如下:
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章