CuDNNError: CUDNN_STATUS_NOT_INITIALIZED: b'CUDNN_STATUS_NOT_INITIALIZED'
CuDNNError Traceback (most recent call last) <ipython-input-12-6c074994336d> in <module>() 53 y_batch = Variable(cuda.to_gpu(label[perm[i:i+batchsize]])) 54 model.zerograds() ---> 55 optimizer.update(model, x_batch, y_batch) 56 #optimizer.zero_grads() 57 #loss, acc = model(x_batch, y_batch) /home/ec2-user/anaconda3/lib/python3.5/site-packages/chainer-1.6.1-py3.5-linux-x86_64.egg/chainer/optimizer.py in update(self, lossfun, *args, **kwds) 374 if lossfun is not None: 375 self.target.zerograds() --> 376 loss = lossfun(*args, **kwds) 377 loss.backward() 378 del loss <ipython-input-7-2e6b715d5a42> in __call__(self, x, t) 26 27 h = F.max_pooling_2d(F.relu( ---> 28 F.local_response_normalization(self.conv1(x))), 3, stride=2) 29 h = F.max_pooling_2d(F.relu( 30 F.local_response_normalization(self.conv2(h))), 3, stride=2) /home/ec2-user/anaconda3/lib/python3.5/site-packages/chainer-1.6.1-py3.5-linux-x86_64.egg/chainer/links/connection/convolution_2d.py in __call__(self, x) 75 """ 76 return convolution_2d.convolution_2d( ---> 77 x, self.W, self.b, self.stride, self.pad, self.use_cudnn) 78 79 /home/ec2-user/anaconda3/lib/python3.5/site-packages/chainer-1.6.1-py3.5-linux-x86_64.egg/chainer/functions/connection/convolution_2d.py in convolution_2d(x, W, b, stride, pad, use_cudnn) 271 return func(x, W) 272 else: --> 273 return func(x, W, b) /home/ec2-user/anaconda3/lib/python3.5/site-packages/chainer-1.6.1-py3.5-linux-x86_64.egg/chainer/function.py in __call__(self, *inputs) 103 # Forward prop 104 with cuda.get_device(*in_data): --> 105 outputs = self.forward(in_data) 106 assert type(outputs) == tuple 107 /home/ec2-user/anaconda3/lib/python3.5/site-packages/chainer-1.6.1-py3.5-linux-x86_64.egg/chainer/function.py in forward(self, inputs) 179 """ 180 if any(isinstance(x, cuda.ndarray) for x in inputs): --> 181 return self.forward_gpu(inputs) 182 else: 183 return self.forward_cpu(inputs) /home/ec2-user/anaconda3/lib/python3.5/site-packages/chainer-1.6.1-py3.5-linux-x86_64.egg/chainer/functions/connection/convolution_2d.py in forward_gpu(self, inputs) 76 b = cuda.cupy.ascontiguousarray(b) 77 ---> 78 handle = cudnn.get_handle() 79 x_desc = cudnn.create_tensor_descriptor(x) 80 y_desc = cudnn.create_tensor_descriptor(y) /home/ec2-user/anaconda3/lib/python3.5/site-packages/chainer-1.6.1-py3.5-linux-x86_64.egg/cupy/cudnn.py in get_handle() 16 handle = _handles.get(device.id, None) 17 if handle is None: ---> 18 handle = cudnn.create() 19 _handles[device.id] = handle 20 return handle cupy/cuda/cudnn.pyx in cupy.cuda.cudnn.create (cupy/cuda/cudnn.cpp:1567)() cupy/cuda/cudnn.pyx in cupy.cuda.cudnn.create (cupy/cuda/cudnn.cpp:1512)() cupy/cuda/cudnn.pyx in cupy.cuda.cudnn.check_status (cupy/cuda/cudnn.cpp:1311)() CuDNNError: CUDNN_STATUS_NOT_INITIALIZED: b'CUDNN_STATUS_NOT_INITIALIZED'
■コード抜粋 =================================================
cuda.init() # 不要なはず
N = img.shape[0]
N_test = t_img.shape[0]
# モデルの指定
model = alex.Alex()
batchsize = 100
n_epoch = 10
# GPU使用設定
dev = cuda.get_device(0)
dev.use()
model.to_gpu(device=dev.id)
# Setup optimizer
optimizer = optimizers.MomentumSGD(lr=0.01, momentum=0.9)
optimizer.setup(model)
train_loss = []
train_acc = []
test_loss = []
test_acc = []
# Learning loop
for epoch in range(1, n_epoch+1):
print ('epoch:{}, {}'.format(epoch, datetime.now().strftime("%Y/%m/%d %H:%M:%S")))
# training
perm = np.random.permutation(N)
sum_accuracy = 0
sum_loss = 0
for i in range(0, N, batchsize):
sys.stdout.write("{},".format(i))
print(img[perm[i:i+batchsize]].dtype)
x_batch = Variable(cuda.to_gpu(img[perm[i:i+batchsize]]))
y_batch = Variable(cuda.to_gpu(label[perm[i:i+batchsize]]))
######## ここで落ちる ########################################################
optimizer.update(model, x_batch, y_batch)
######## ここで落ちる ########################################################
Python 3.5.1 |Anaconda 2.5.0 (64-bit)| (default, Dec 7 2015, 11:16:01)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
となっています。
このディスカッションをウェブ上で閲覧するには https://groups.google.com/d/msgid/chainer-jp/9af9c06e-84ac-423d-b3a0-32174fd901e8%40googlegroups.com にアクセスしてください。--
このメールは Google グループのグループ「Chainer Japanese User Group」に登録しているユーザーに送られています。
このグループから退会し、グループからのメールの配信を停止するには chainer-jp+...@googlegroups.com にメールを送信してください。
このグループに投稿するには chain...@googlegroups.com にメールを送信してください。
その他のオプションについては https://groups.google.com/d/optout にアクセスしてください。
libcudnn.so
libcudnn.so.7.0
libcudnn.so.7.0.64
libcudnn_static.a
cudnn.h
このディスカッションをウェブ上で閲覧するには https://groups.google.com/d/msgid/chainer-jp/6683a786-9d74-4b3f-b08e-de6ed2fee072%40googlegroups.com にアクセスしてください。
その他のオプションについては https://groups.google.com/d/optout にアクセスしてください。
AttributeError Traceback (most recent call last) <ipython-input-1-9be92a6557a2> in <module>() 1 import pycuda.autoinit 2 from pycuda import gpuarray ----> 3 import libcudnn, ctypes 4 import numpy as np 5 /home/ec2-user/anaconda3/lib/python3.5/site-packages/libcudnn.py in <module>() 309 return id.value 310 --> 311 _libcudnn.cudnnCreateTensor4dDescriptor.restype = int 312 _libcudnn.cudnnCreateTensor4dDescriptor.argtypes = [ctypes.c_void_p] 313 def cudnnCreateTensor4dDescriptor(): /home/ec2-user/anaconda3/lib/python3.5/ctypes/__init__.py in __getattr__(self, name) 358 if name.startswith('__') and name.endswith('__'): 359 raise AttributeError(name) --> 360 func = self.__getitem__(name) 361 setattr(self, name, func) 362 return func /home/ec2-user/anaconda3/lib/python3.5/ctypes/__init__.py in __getitem__(self, name_or_ordinal) 363 364 def __getitem__(self, name_or_ordinal): --> 365 func = self._FuncPtr((name_or_ordinal, self)) 366 if not isinstance(name_or_ordinal, int): 367 func.__name__ = name_or_ordinal AttributeError: /opt/nvidia/cuda/lib64/libcudnn.so: undefined symbol: cudnnCreateTensor4dDescriptor
このディスカッションをウェブ上で閲覧するには https://groups.google.com/d/msgid/chainer-jp/17ccf4cb-bae4-4941-bb66-18a4b0d6b765%40googlegroups.com にアクセスしてください。
その他のオプションについては https://groups.google.com/d/optout にアクセスしてください。