win10自带linux+caffe安装记录

本文详细记录了在Windows 10内置Linux环境中安装Caffe的过程,包括配置Ubuntu子系统的步骤、更换apt源、安装依赖软件包及Caffe的编译配置等关键信息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

win10自带linux+caffe安装记录

公司的server环境都是配好的,mac用brew装也非常方便,因为不能用vpn,要写测试工程,只能用自己的破win10装了,一上午可算捣鼓好了,现在记录一下安装记录。(没装GPU,只是用CPU)

一、win10安装linux

在win10的应用商店搜索linux,会出来ubuntu的应用,安装就好了,具体网上很多,搜一下就好了

二、换apt的源

cd /etc/apt/
sudo cp sources.list back.list
chmod 777 sources.list

然后修改sources.list,敲入

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main

然后更新源

sudo apt-get update

三、安装依赖

可参照caffe官网http://caffe.berkeleyvision.org/install_apt.html

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install --no-install-recommends libboost-all-dev
sudo apt-get install libopenblas-dev # 这里用的openblas

四、安装caffe

从git上随便拉一个就好
改Makefile.cfg
注意修改INCLUDE_DIRS,LIBRARY_DIRS(hdf5的问题,不改编就会出现问题)

#INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
#LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial

用cpu的话,CPU_ONLY注释去掉
用python的话,把WITH_PYTHON_LAYER注释去掉

五、编译

make -j

如果用python接口

make pycaffe
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值