python - 调用GPU运行CNN程序时遇到Cublas error
PHPz
PHPz 2017-04-18 10:11:15
0
0
956

在Ubuntu 14.04尝试使用GPU运行mnielsen的样例代码 src/network3.py
https://github.com/mnielsen/n...
时报错Cublas error
调用代码是

   import network3
   from network3 import Network
   from network3 import ConvPoolLayer,FullyConnectedLayer,SoftmaxLayer

   traning_data,validation_data,test_data=network3.load_data_shared()
   expanded_training_data,_,_=network3.load_data_shared()
   mini_batch_size=10

   net=Network([
         ConvPoolLayer(image_shape=(mini_batch_size,1,28,28),
                       filter_shape=(20,1,5,5),
                       poolsize=(2,2)
                       ),
         ConvPoolLayer(image_shape=(mini_batch_size,20,12,12),
                       filter_shape=(40,20,5,5),
                       poolsize=(2,2)
                       ),
         FullyConnectedLayer(n_in=40*4*4,n_out=100),
         FullyConnectedLayer(n_in=100,n_out=100),
         SoftmaxLayer(n_in=100,n_out=10)],mini_batch_size)
  net.SGD(expanded_training_data,40,mini_batch_size,0.03,validation_data, test_data) 
  

运行结果是

RuntimeError: GpuCorrMM encountered a CUBLAS error: the library was not initialized
This could be a known bug in CUDA, please see the GpuCorrMM() documentation.

theanorc的配置是

  [global]
   openmp=False
   floatX=float32
   device=gpu
   allow_input_downcast=True

   [blas]
   ldflags=-lopenblas

   [nvcc]
   flags=-LC:/home/fang/anaconda2/lib
   fastmath=True

   [cuda]
   root=/usr/local/cuda-8.0
   
       

GPU使用的是Nvidia GeForce GTX 460
其它环境分别是cuda 8.0, theano 0.8.2, 使用的调试平台是eclipse pydev
这个问题困扰很久了,查了很多资料也没有解决,第一次上来提问,希望能得到解决,谢谢!

PHPz
PHPz

学习是最好的投资!

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!