安装cuda-convnet

本文介绍了CUDA-ConvNet2的安装过程及遇到的问题解决办法,包括配置路径、编译错误处理、显卡兼容性调整等,并分享了使用经验。

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

首先,通过git下载cuda-convnet2的代码,在build.sh中调整一下路径,就可以成功build了。

装好后想进行一下测试,就取网上找数据,发现imagenet实在太大,就准备用cifar-10。只有10类,50000 train batches, 10000 test batches。下载地址为http://www.cs.toronto.edu/~kriz/cifar-10-py-colmajor.tar.gz

下载完后,用python打开保存在meta中的dict,用cPickle解压就行。然后执行python convnet.py --data-path=./dataset/srcdir/cifar-10-py-colmajor/ --save-path=./dataset/tardir/ --test-range=6 --train-range=1-5 --layer-def=./layers/layers-cifar10-11pct.cfg --layer-params=./layers/layer-params-cifar10-11pct.cfg --data-provider=cifar --test-freq=13 --gpu=0

发现出错,在convdata.py中修改img_size为32。。。再跑还是不行src/nvmatrix.cu(394) : getLastCudaError() CUDA error : kSetupCurand: Kernel execution failed : (8) invalid device function .似乎是gtx660 compute capability只有3.0达不到要求。然后尝试修改makefile

To solve the issue we needed to change the makefiles in cuda-convnet2/nvmatrix ,cuda-convnet2/cudaconv3 and cuda-convnet2/cudaconvnet.

In all the three files we added references to architecture 50 in the CUDA code generation flags (used to have only reference to 35), so the section should now look like:

# CUDA code generation flags

GENCODE_SM35 := -gencode arch=compute_35,code=sm_35

GENCODE_SM50 := -gencode arch=compute_50,code=sm_50 GENCODE_FLAGS := $(GENCODE_SM35) $(GENCODE_SM50)

After making the changed you should probably also do a ./build.sh clean and then a new build.

但是build不成功,恐怕还是要换显卡。

不过对cuda-convnet2还是更熟悉了一些,主要通过配置layer参数来使用,还是很方便的。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值