资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

使用anaconda安装caffe-创新互联

通过 conda 安装 caffe-gpu 和 caffe

为印台等地区用户提供了全套网页设计制作服务,及印台网站建设行业解决方案。主营业务为成都网站设计、网站制作、印台网站设计,以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。我们深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

一开始直接使用conda安装caffe结果报错。通过不断搜索,最终找到了解决方法:

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

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

解决方案的原链接在此。安装caffe_gpu时,对应版本的cudatoolkit 、cudnn 也会被安装。

外网大神的原话是:

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这个频道,而不能使用或者上混合使用Anaconda 、 conda-forge这些频道的库。

我遇到的问题:

由于一开始 create python 虚拟环境的时候使用conda-forge, 安装caffe时混合了defaults(第一次)、Anaconda(第二次)的库,结果出现了下面的错误:

>>> 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

>>>

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


新闻名称:使用anaconda安装caffe-创新互联
链接地址:http://cdkjz.cn/article/pipch.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220