溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

使用anaconda安裝caffe

發(fā)布時(shí)間:2020-08-02 05:46:33 來源:網(wǎng)絡(luò) 閱讀:2252 作者:ckllf 欄目:編程語言

  通過 conda 安裝 caffe-gpu 和 caffe

  一開始直接使用conda安裝caffe結(jié)果報(bào)錯(cuò)。通過不斷搜索,最終找到了解決方法:

  conda create -n caffe_gpu -c defaults python=3.6 caffe-gpu

  或

  conda create -n caffe -c defaults python=3.6 caffe

  解決方案的原鏈接在此。安裝caffe_gpu時(shí),對(duì)應(yīng)版本的cudatoolkit 、cudnn 也會(huì)被安裝。

  外網(wǎng)大神的原話是:

  I will repeat my comment from earlier in this issue, please do not use the anaconda channel when installing caffe, it does not preserve the priority between the main and free sub-channels. Installing caffe or caffe-gpu from the defaults channel is the only method supported by Anaconda and currently works. For example the following two command will create working environments:

  conda create -n caffe_gpu -c defaults python=3.6 caffe-gpu

  conda create -n caffe -c defaults python=3.6 caffe

  意思就是要想通過conda安裝caffe,所有庫必須全部使用defaults這個(gè)頻道,而不能使用或者上混合使用Anaconda 、 conda-forge這些頻道的庫。

  我遇到的問題:

  由于一開始 create python 虛擬環(huán)境的時(shí)候使用conda-forge, 安裝caffe時(shí)混合了defaults(第一次)、Anaconda(第二次)的庫,結(jié)果出現(xiàn)了下面的錯(cuò)誤:

  >>> import caffe

  Failed to include caffe_pb2, things might go wrong!

  Traceback (most recent call last):

  File "", line 1, in

  File "/home/allen/anaconda3/envs/caffegpu/lib/python3.5/site-packages/caffe/__init__.py", line 4, in

  from .proto.caffe_pb2 import TRAIN, TEST無錫人流多少錢 http://www.bhnnk120.com/

  File "/home/allen/anaconda3/envs/caffegpu/lib/python3.5/site-packages/caffe/proto/caffe_pb2.py", line 7, in

  from google.protobuf import descriptor as _descriptor

  File "/home/allen/anaconda3/envs/caffegpu/lib/python3.5/site-packages/google/protobuf/descriptor.py", line 47, in

  from google.protobuf.pyext import _message

  ImportError: /home/allen/anaconda3/envs/caffegpu/lib/python3.5/site-packages/google/protobuf/pyext/_message.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _ZNK6google8protobuf10TextFormat17FieldValuePrinter9PrintBoolEb

  >>>

  >>> import caffe

  Traceback (most recent call last):

  File "", line 1, in

  File "/home/allen/anaconda3/envs/caffe/lib/python3.5/site-packages/caffe/__init__.py", line 1, in

  from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer

  File "/home/allen/anaconda3/envs/caffe/lib/python3.5/site-packages/caffe/pycaffe.py", line 13, in

  from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \

  ImportError: /home/allen/anaconda3/envs/caffe/lib/python3.5/site-packages/caffe/../../../libcaffe.so.1.0.0: undefined symbol: _ZNK7leveldb6Status8ToStringB5cxx11Ev

  >>>


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI