运行时报错:failed call to cuInit: CUDA_ERROR_NO_DEVICE

import tensorflow 正常, tensorflow-gpu==1.0.0, cuda8.0, sudnn5.0, CPU-E6700, GPU-quadro-410, 但 运行时报错:failed call to cuInit: CUDA_ERROR_NO_DEVICE

有建议吗 ? 谢谢帮助。

I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfully opened CUDA library cublas64_80.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfully opened CUDA library cudnn64_5.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfully opened CUDA library cufft64_80.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfully opened CUDA library nvcuda.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:135] successfully opened CUDA library curand64_80.dll locally
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "BestSplits" device_type: "CPU"') for unknown op: BestSplits
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "CountExtremelyRandomStats" device_type: "CPU"') for unknown op: CountExtremelyRandomStats
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "FinishedNodes" device_type: "CPU"') for unknown op: FinishedNodes
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "GrowTree" device_type: "CPU"') for unknown op: GrowTree
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ReinterpretStringToFloat" device_type: "CPU"') for unknown op: ReinterpretStringToFloat
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "SampleInputs" device_type: "CPU"') for unknown op: SampleInputs
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "ScatterAddNdim" device_type: "CPU"') for unknown op: ScatterAddNdim
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNInsert" device_type: "CPU"') for unknown op: TopNInsert
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TopNRemove" device_type: "CPU"') for unknown op: TopNRemove
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "TreePredictions" device_type: "CPU"') for unknown op: TreePredictions
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\framework\op_kernel.cc:943] OpKernel ('op: "UpdateFertileSlots" device_type: "CPU"') for unknown op: UpdateFertileSlots
E c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_driver.cc:509] failed call to cuInit: CUDA_ERROR_NO_DEVICE

3个回答

运行cuda 8.0的samples里面的devicequery,看下你的卡,是否安装正确了。并且计算能力是不是>3.0
410这个显卡,虽然号称“专业卡”,但是实际上性能连市面上100块钱价位的GTX650都不如。这种卡运算能力甚至比高端一些的CPU都低,真正是所谓“为了提高性能,请拔下独立显卡”。

你好, 曹先生:
以下是deviceQuery 的输出, 有建议吗。 多谢。

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\extras\demo_suite>deviceQuery
deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "Quadro 410"
CUDA Driver Version / Runtime Version 8.0 / 8.0
CUDA Capability Major/Minor version number: 3.0
Total amount of global memory: 512 MBytes (536870912 bytes)
( 1) Multiprocessors, (192) CUDA Cores/MP: 192 CUDA Cores
GPU Max Clock rate: 706 MHz (0.71 GHz)
Memory Clock rate: 891 Mhz
Memory Bus Width: 64-bit
L2 Cache Size: 131072 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536, 65536), 3D=(4096, 4096, 4096)
Maximum Layered 1D Texture Size, (num) layers 1D=(16384), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(16384, 16384), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 2048
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 1 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
CUDA Device Driver Mode (TCC or WDDM): WDDM (Windows Display Driver Model)
Device supports Unified Addressing (UVA): Yes
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = Quadro 410
Result = PASS

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\extras\demo_suite>

caozhy
贵阳老马马善福专业维修游泳池堵漏防水工程 这个卡理论上也许是支持的,但是即便支持,意义也不大,只有0.5G的内存和1个SM核,比市面上100块钱的GTX650还要差很多(GTX650是2个SM核,1GB~2GB显存)。你遇到的问题可能还是cuda和cudnn的版本不对。我没有用过TF1.0,在TF1.8上,搭配的是cuda9.0和cudnn 7.5,你可以参考下。
一年多之前 回复

下面是我的deviceQuery,和原作者一样的报错。是否一个gpu就会报错呢?我用tensorflow2.0, GeForce RTX 2070 显卡。
C:\Users\Administrator>deviceQuery
deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "GeForce RTX 2070"
CUDA Driver Version / Runtime Version 10.1 / 10.0
CUDA Capability Major/Minor version number: 7.5
Total amount of global memory: 8192 MBytes (8589934592 bytes)
(36) Multiprocessors, ( 64) CUDA Cores/MP: 2304 CUDA Cores
GPU Max Clock rate: 1620 MHz (1.62 GHz)
Memory Clock rate: 7001 Mhz
Memory Bus Width: 256-bit
L2 Cache Size: 4194304 bytes
Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(131072, 65536), 3D=(16384, 16384, 16384)
Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers
Maximum Layered 2D Texture Size, (num) layers 2D=(32768, 32768), 2048 layers
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 49152 bytes
Total number of registers available per block: 65536
Warp size: 32
Maximum number of threads per multiprocessor: 1024
Maximum number of threads per block: 1024
Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
Max dimension size of a grid size (x,y,z): (2147483647, 65535, 65535)
Maximum memory pitch: 2147483647 bytes
Texture alignment: 512 bytes
Concurrent copy and kernel execution: Yes with 3 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Alignment requirement for Surfaces: Yes
Device has ECC support: Disabled
CUDA Device Driver Mode (TCC or WDDM): WDDM (Windows Display Driver Model)
Device supports Unified Addressing (UVA): Yes
Device supports Compute Preemption: Yes
Supports Cooperative Kernel Launch: No
Supports MultiDevice Co-op Kernel Launch: No
Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 10.1, CUDA Runtime Version = 10.0, NumDevs = 1, Device0 = GeForce RTX 2070
Result = PASS

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Python+OpenCV计算机视觉

Python+OpenCV计算机视觉

cuda 报错 CUDA_ERROR_LAUNCH_FAILED

template<typename T> __global__ void pooling_max_kernel (T* pooled, const T* data, const T* stochastic_value, const int mode, const int pooledWidth, const int pooledHeight, const int pooledVolume, const int width, const int height, const int poolWidth, const int poolHeight, const int strideX, const int strideY, const int padLeft, const int padTop) { int pooledIndex = threadIdx.x + blockIdx.x * blockDim.x; int stochastic_value_index=0; if (pooledIndex < pooledVolume) { int px = pooledIndex ; int py = px / pooledWidth ; int pz = py / pooledHeight ; px %= pooledWidth ; py %= pooledHeight ; data += pz * (width*height) ; int x1 = px * strideX - padLeft ; int y1 = py * strideY - padTop ; int x2 = min(x1 + poolWidth, width) ; int y2 = min(y1 + poolHeight, height) ; x1 = max(x1, 0) ; y1 = max(y1, 0) ; //T *savedata;T *dataprob; //cudaMalloc((void**)&savedata,sizeof(T)*9);cudaMalloc((void**)&dataprob,sizeof(T)*9);/////////////////////////////////////////////////定义变量分配内存 T savedata[9]={0};T dataprob[10]={0};dataprob[0]=0; T sumdata=0;T weightsum=0;int i=0;/////////////////////////////lyz //T bestValue = data[y1 * width + x1] ; for (int y = y1 ; y < y2 ; ++y) { for (int x = x1 ; x < x2 ; ++x) { //bestValue = max(bestValue, data[y * width + x]) ; savedata[i]=data[y * width + x]; sumdata=sumdata+data[y * width + x]; i=i+1; if (i>8) {i=0;} } } if(mode==0) { T randdata = stochastic_value[pooledIndex]; if (sumdata>0) { for(int j=0;j<poolWidth*poolHeight;++j) { dataprob[j+1]=dataprob[j]+savedata[j]/sumdata; if (randdata<dataprob[j+1]) { stochastic_value_index=j; break; } } pooled[pooledIndex] = savedata[stochastic_value_index] ; } else { pooled[pooledIndex] = 0 ; } } else { if (sumdata>0) { for(int j=0;j<poolWidth*poolHeight;++j) { weightsum=weightsum+savedata[j]*savedata[j]/sumdata; } pooled[pooledIndex] = weightsum ; } else { pooled[pooledIndex] = 0 ; } } //cudaFree(savedata);cudaFree(dataprob); } } 另,在kernel函数中定义变量需要分配内存吗,我之前用注释掉的那个分配内存,编译的时候回报错

cuda运行错误,call to cuMemcpy failed, 返回错误代码700

我在运行mpi+cuda程序的时候,显示 call to cuMemcpy failed cuMemcpy return value: 700 在cuda.h中查了一下错误代码700的解释如下: While executing a kernel, the device encountered a load or store instruction on an invalid memory address.This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched. 求问该如何解决。

CUDA错误 __global__ funtion call

![图片说明](https://img-ask.csdn.net/upload/201611/12/1478933464_386524.jpg) 不是很懂CUDA,求助这是什么错

求助:CUDA的RuntimeError:cuda runtime error (30)

``` from torchvision import models use_gpu = torch.cuda.is_available() model_ft = models.resnet18(pretrained = True) if use_gpu: model_ft = model_ft.cuda() ``` 运行后报错: ``` RuntimeError Traceback (most recent call last) <ipython-input-6-87942ec8aa13> in <module>() 11 model_ft.fc = nn.Linear(num_ftrs , 5)#############################2 12 if use_gpu: ---> 13 model_ft = model_ft.cuda() 14 #criterion = nn.MultiMarginLoss() 15 criterion = nn.CrossEntropyLoss() ~\Anaconda3\lib\site-packages\torch\nn\modules\module.py in cuda(self, device) 258 Module: self 259 """ --> 260 return self._apply(lambda t: t.cuda(device)) 261 262 def cpu(self): ~\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _apply(self, fn) 185 def _apply(self, fn): 186 for module in self.children(): --> 187 module._apply(fn) 188 189 for param in self._parameters.values(): ~\Anaconda3\lib\site-packages\torch\nn\modules\module.py in _apply(self, fn) 191 # Tensors stored in modules are graph leaves, and we don't 192 # want to create copy nodes, so we have to unpack the data. --> 193 param.data = fn(param.data) 194 if param._grad is not None: 195 param._grad.data = fn(param._grad.data) ~\Anaconda3\lib\site-packages\torch\nn\modules\module.py in <lambda>(t) 258 Module: self 259 """ --> 260 return self._apply(lambda t: t.cuda(device)) 261 262 def cpu(self): ~\Anaconda3\lib\site-packages\torch\cuda\__init__.py in _lazy_init() 160 "Cannot re-initialize CUDA in forked subprocess. " + msg) 161 _check_driver() --> 162 torch._C._cuda_init() 163 _cudart = _load_cudart() 164 _cudart.cudaGetErrorName.restype = ctypes.c_char_p RuntimeError: cuda runtime error (30) : unknown error at ..\aten\src\THC\THCGeneral.cpp:87 ``` Win10+Anaconda5.0.1+python3.6.3 Cuda driver version 10.1 Cuda Toolkit 10.1 pytorch 1.0.1 显卡GeForce GTX 1050 Ti nvidia驱动版本430.39 求助啊!!!

ImportError: No module named '_pywrap_tensorflow_internal'

tensorflow==1.5.0 安装成功;继续安装gpu版本,按系统提示再安装 CUDA-9.0, cuDNN-7.0: cuda_9.0.176_win10_network以及patch1-4 / cudnn-9.0-windows10-x64-v7.3.1.20. 运行‘import tensorflow as tf’后报错: ImportError: No module named '_pywrap_tensorflow_internal' 谢谢帮助 --------------------------------------------------------------------------- ImportError Traceback (most recent call last) C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper() 17 try: ---> 18 return importlib.import_module(mname) 19 except ImportError: C:\Program Files\Anaconda3\lib\importlib\__init__.py in import_module(name, package) 125 level += 1 --> 126 return _bootstrap._gcd_import(name[level:], package, level) 127 C:\Program Files\Anaconda3\lib\importlib\_bootstrap.py in _gcd_import(name, package, level) C:\Program Files\Anaconda3\lib\importlib\_bootstrap.py in _find_and_load(name, import_) C:\Program Files\Anaconda3\lib\importlib\_bootstrap.py in _find_and_load_unlocked(name, import_) C:\Program Files\Anaconda3\lib\importlib\_bootstrap.py in _load_unlocked(spec) C:\Program Files\Anaconda3\lib\importlib\_bootstrap.py in module_from_spec(spec) C:\Program Files\Anaconda3\lib\importlib\_bootstrap_external.py in create_module(self, spec) C:\Program Files\Anaconda3\lib\importlib\_bootstrap.py in _call_with_frames_removed(f, *args, **kwds) ImportError: DLL load failed: 找不到指定的程序。 During handling of the above exception, another exception occurred: ImportError Traceback (most recent call last) C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>() 57 ---> 58 from tensorflow.python.pywrap_tensorflow_internal import * 59 from tensorflow.python.pywrap_tensorflow_internal import __version__ C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in <module>() 20 return importlib.import_module('_pywrap_tensorflow_internal') ---> 21 _pywrap_tensorflow_internal = swig_import_helper() 22 del swig_import_helper C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py in swig_import_helper() 19 except ImportError: ---> 20 return importlib.import_module('_pywrap_tensorflow_internal') 21 _pywrap_tensorflow_internal = swig_import_helper() C:\Program Files\Anaconda3\lib\importlib\__init__.py in import_module(name, package) 125 level += 1 --> 126 return _bootstrap._gcd_import(name[level:], package, level) 127 ImportError: No module named '_pywrap_tensorflow_internal' During handling of the above exception, another exception occurred: ImportError Traceback (most recent call last) <ipython-input-1-41389fad42b5> in <module>() ----> 1 import tensorflow as tf C:\Program Files\Anaconda3\lib\site-packages\tensorflow\__init__.py in <module>() 22 23 # pylint: disable=wildcard-import ---> 24 from tensorflow.python import * 25 # pylint: enable=wildcard-import 26 C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>() 47 import numpy as np 48 ---> 49 from tensorflow.python import pywrap_tensorflow 50 51 # Protocol buffers C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>() 72 for some common reasons and solutions. Include the entire stack trace 73 above this error message when asking for help.""" % traceback.format_exc() ---> 74 raise ImportError(msg) 75 76 # pylint: enable=wildcard-import,g-import-not-at-top,unused-import,line-too-long ImportError: Traceback (most recent call last): File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper return importlib.import_module(mname) File "C:\Program Files\Anaconda3\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 986, in _gcd_import File "<frozen importlib._bootstrap>", line 969, in _find_and_load File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 666, in _load_unlocked File "<frozen importlib._bootstrap>", line 577, in module_from_spec File "<frozen importlib._bootstrap_external>", line 906, in create_module File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed ImportError: DLL load failed: 找不到指定的程序。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "C:\Program Files\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File "C:\Program Files\Anaconda3\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: No module named '_pywrap_tensorflow_internal' Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

pycuda报错cuMemFree failed

报错内存释失败:Traceback (most recent call last): File "filter_cuda.py", line 103, in <module> bilateral = Bilateral_filter(img,template_size,sigma[0],sigma[1]) File "filter_cuda.py", line 93, in Bilateral_filter block=(template_size,template_size,3),grid=(rows,cols)) File "/usr/local/lib/python3.5/dist-packages/pycuda/driver.py", line 405, in function_call Context.synchronize() pycuda._driver.LogicError: cuCtxSynchronize failed: an illegal memory access was encountered PyCUDA WARNING: a clean-up operation failed (dead context maybe?) cuMemFree failed: an illegal memory access was encountered PyCUDA WARNING: a clean-up operation failed (dead context maybe?) cuMemFree failed: an illegal memory access was encountered PyCUDA WARNING: a clean-up operation failed (dead context maybe?) cuMemFree failed: an illegal memory access was encountered PyCUDA WARNING: a clean-up operation failed (dead context maybe?) cuMemFree failed: an illegal memory access was encountered PyCUDA WARNING: a clean-up operation failed (dead context maybe?) cuModuleUnload failed: an illegal memory access was encountered ``` import os,math,cv2,numpy from PIL import Image import numpy as np import skimage import pycuda.autoinit import pycuda.driver as drv from pycuda.compiler import SourceModule from timeit import default_timer as timer mod = SourceModule(""" #include<math.h> __global__ void Gauss_cuda(int ***img,int ***im,float **disTemplate,int template_size) { int x = blockIdx.x * blockDim.x + threadIdx.x; int y = blockIdx.y * blockDim.y + threadIdx.y; int z = threadIdx.z; int count = 0; for(int i=x;i<x+template_size;i++) { for(int j=y;j<y+template_size;j++) { count += im[i][j][z]*disTemplate[i][j]; } } img[x][y][z] = count; } __global__ void bilateral_cuda(float ***img,float ***orig,float **disTemplate,float *ourArg) { int x = blockIdx.x * blockDim.x + threadIdx.x; int y = blockIdx.y * blockDim.y + threadIdx.y; int z = threadIdx.z; int xmin = max(int(x-int(ourArg[0])),0); int xmax = min(int(x+int(ourArg[0])+1),int(ourArg[1])); int ymin = max(int(y-int(ourArg[0])),0); int ymax = min(int(y+int(ourArg[0])+1),int(ourArg[2])); int w = 0; int v = 0; for(int i=xmin;i<xmax;i++) { for(int j=ymin;j<ymax;j++) { w += w+disTemplate[xmin-x+int(ourArg[0])+i][ymin-y+int(ourArg[0])+i]*exp((orig[i][j][z]-orig[x][y][z])*(orig[i][j][z]-orig[x][y][z])/(2*ourArg[3]*ourArg[3])); v += orig[x][y][z]*w; } } img[x][y][z] = v/w; } """) Gauss_cuda = mod.get_function("Gauss_cuda") bilateral_cuda = mod.get_function("bilateral_cuda") def generateGaussianTemplate(template_size,sigma): template = np.zeros((template_size,template_size)) mid = template_size/2 sum = 0 pi = 3.1415926 for i in range(template_size): x = pow(i-mid,2) for j in range(template_size): y = pow(j-mid,2) g = math.exp((x+y)/(-2*sigma*sigma))/(2*pi*sigma) template[i][j] = g sum+=g #归一化 template = template/sum return template def Gauss_filter(img,template_size,sigma): [rows,cols,channel] = img.shape border = int(template_size/2) template = generateGaussianTemplate(template_size,sigma) im = cv2.copyMakeBorder(img,border,border,border,border,cv2.BORDER_REPLICATE) Gauss_cuda( drv.InOut(img), drv.In(im), drv.In(template),template_size, block=(template_size,template_size,3),grid=(rows,cols)) return img def Bilateral_filter(img,template_size,sigma1,sigma2): img = img/255 border = int(template_size/2) [rows,cols,channel] = img.shape tmp = np.arange(-border,border+1) [x,y] = np.meshgrid(tmp,tmp) X = np.power(x,2) Y = np.power(y,2) d = np.exp(-(X+Y)/(2*sigma1*sigma1)) orig_img = img bilateral_cuda( drv.InOut(img), drv.In(orig_img), drv.In(d),drv.In(np.array([border,rows,cols,sigma2])), block=(template_size,template_size,3),grid=(rows,cols)) return img*255 if __name__=='__main__': img = cv2.imread('demo2.jpg') #noise = skimage.util.random_noise(img,'gaussian')*255 #cv2.imwrite('noise.jpg',noise) template_size = 3 sigma_g = 0.8 sigma = [3,0.1] bilateral = Bilateral_filter(img,template_size,sigma[0],sigma[1]) Gauss = Gauss_filter(img,template_size,sigma_g) cv2.imwrite('bilateral_result_{}_{}_{}.jpg'.format(template_size,sigma[0],sigma[1]),bilateral) cv2.imwrite('Gauss_result_{}_{}.jpg'.format(template_size,sigma_g),Gauss) ```

tensorflow代码用CPU运行时没有错误,用GPU运行时每次到51%报错,网上没有搜到相同的问题

51%|████████████████████████████████████████████████████████████████████████████████████████████████████▎ | 199/391 [00:38<00:21, 8.81it/s]2019-08-12 20:20:04.963304: I tensorflow/core/kernels/cuda_solvers.cc:159] Creating CudaSolver handles for stream 0000016EAC1D0A40 2019-08-12 20:20:05.763636: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 85505 for batch index 0, expected info = 0. Debug_info = heevd ** On entry to SGEMM parameter number 10 had an illegal value 2019-08-12 20:20:06.320473: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 5236925 for batch index 0, expected info = 0. Debug_info = heevd 2019-08-12 20:20:06.328931: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 1871 for batch index 0, expected info = 0. Debug_info = heevd 2019-08-12 20:20:06.838588: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 687520 for batch index 0, expected info = 0. Debug_info = heevd 2019-08-12 20:20:06.850771: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 321 for batch index 0, expected info = 0. Debug_info = heevd 2019-08-12 20:20:06.999345: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 42770 for batch index 0, expected info = 0. Debug_info = heevd 2019-08-12 20:20:07.499292: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 1497278 for batch index 0, expected info = 0. Debug_info = heevd 2019-08-12 20:20:07.510245: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 321 for batch index 0, expected info = 0. Debug_info = heevd 2019-08-12 20:20:08.020011: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 256112 for batch index 0, expected info = 0. Debug_info = heevd 2019-08-12 20:20:08.529828: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 341471 for batch index 0, expected info = 0. Debug_info = heevd 2019-08-12 20:20:08.540870: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 16833 for batch index 0, expected info = 0. Debug_info = heevd 2019-08-12 20:20:08.697339: W tensorflow/core/framework/op_kernel.cc:1401] OP_REQUIRES failed at cuda_solvers.cc:260 : Invalid argument: Got info = 1190 for batch index 0, expected info = 0. Debug_info = heevd Traceback (most recent call last): File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1334, in _do_call return fn(*args) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1319, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1407, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: Got info = 85505 for batch index 0, expected info = 0. Debug_info = heevd [[{{node KFAC/SelfAdjointEigV2_10}}]] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "main.py", line 67, in <module> main() File "main.py", line 63, in main trainer.train() File "E:\python代码\noisy-K-FAC\noisy-K-FAC\core\train.py", line 16, in train self.train_epoch() File "E:\python代码\noisy-K-FAC\noisy-K-FAC\core\train.py", line 42, in train_epoch self.sess.run([self.model.inv_update_op, self.model.var_update_op], feed_dict=feed_dict) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 929, in run run_metadata_ptr) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1152, in _run feed_dict_tensor, options, run_metadata) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1328, in _do_run run_metadata) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1348, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.InvalidArgumentError: Got info = 85505 for batch index 0, expected info = 0. Debug_info = heevd [[node KFAC/SelfAdjointEigV2_10 (defined at E:\python代码\noisy-K-FAC\noisy-K-FAC\ops\utils.py:161) ]] Caused by op 'KFAC/SelfAdjointEigV2_10', defined at: File "main.py", line 67, in <module> main() File "main.py", line 60, in main model_ = Model(config, _INPUT_DIM[config.dataset], len(train_loader.dataset)) File "E:\python代码\noisy-K-FAC\noisy-K-FAC\core\model.py", line 21, in __init__ self.init_optim() File "E:\python代码\noisy-K-FAC\noisy-K-FAC\core\model.py", line 70, in init_optim momentum=self.config.momentum) File "E:\python代码\noisy-K-FAC\noisy-K-FAC\ops\optimizer.py", line 66, in __init__ inv_devices=inv_devices) File "E:\python代码\noisy-K-FAC\noisy-K-FAC\ops\estimator.py", line 58, in __init__ setup = self._setup(cov_ema_decay) File "E:\python代码\noisy-K-FAC\noisy-K-FAC\ops\estimator.py", line 108, in _setup inv_updates = {op.name: op for op in self._get_all_inverse_update_ops()} File "E:\python代码\noisy-K-FAC\noisy-K-FAC\ops\estimator.py", line 108, in <dictcomp> inv_updates = {op.name: op for op in self._get_all_inverse_update_ops()} File "E:\python代码\noisy-K-FAC\noisy-K-FAC\ops\estimator.py", line 116, in _get_all_inverse_update_ops for op in factor.make_inverse_update_ops(): File "E:\python代码\noisy-K-FAC\noisy-K-FAC\ops\fisher_factors.py", line 360, in make_inverse_update_ops ops.append(inv.assign(utils.posdef_inv(self._cov, damping))) File "E:\python代码\noisy-K-FAC\noisy-K-FAC\ops\utils.py", line 144, in posdef_inv return posdef_inv_functions[POSDEF_INV_METHOD](tensor, identity, damping) File "E:\python代码\noisy-K-FAC\noisy-K-FAC\ops\utils.py", line 161, in posdef_inv_eig tensor + damping * identity) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\ops\linalg_ops.py", line 328, in self_adjoint_eig e, v = gen_linalg_ops.self_adjoint_eig_v2(tensor, compute_v=True, name=name) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\ops\gen_linalg_ops.py", line 2016, in self_adjoint_eig_v2 "SelfAdjointEigV2", input=input, compute_v=compute_v, name=name) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper op_def=op_def) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func return func(*args, **kwargs) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3300, in create_op op_def=op_def) File "D:\softAPP\python\anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1801, in __init__ self._traceback = tf_stack.extract_stack() InvalidArgumentError (see above for traceback): Got info = 85505 for batch index 0, expected info = 0. Debug_info = heevd [[node KFAC/SelfAdjointEigV2_10 (defined at E:\python代码\noisy-K-FAC\noisy-K-FAC\ops\utils.py:161) ]] ``` ```

opencv+cuda关于GpuMat数据转递问题

萌新刚刚接触opencv+cuda不久,还不是很熟练,现在碰到了一个问题,不知道有没有大佬知道解决方法 实际问题中我想定义一个GpuMat类型的数组,例如cv::cuda::GpuMat cu_proj[10][128]; 然后传递给核函数的时候就显示如下错误 error : no suitable constructor exists to convert from "cv::cuda::GpuMat [10][128]" to "cv::cuda::PtrStepSz<uchar1>" 我网上搜到的都是单个GpuMat的传递,不知道我这种情况有没有解决方法呀?以及如果有,在核函数中应该怎么索引呢?我试过cu_proj[x][y](i, y),也显示错误: error : no operator "[]" matches these operands 感激不尽!

cuda加速的問題,opencv3.1.0+cuda8.0

使用的是opencv3.1.0+cuda8.0,但是make可以,run出錯。 nvidia@tegra-ubuntu:~$ cd project_wly nvidia@tegra-ubuntu:~/project_wly$ cmake . -- The C compiler identification is GNU 5.4.0 -- The CXX compiler identification is GNU 5.4.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /home/nvidia/project_wly nvidia@tegra-ubuntu:~/project_wly$ make Scanning dependencies of target project_wly [ 50%] Building CXX object CMakeFiles/project_wly.dir/project_wly.cpp.o [100%] Linking CXX executable project_wly [100%] Built target project_wly nvidia@tegra-ubuntu:~/project_wly$ ./project_wly **OpenCV Error: Gpu API call (invalid device symbol) in loadUMax, file /home/nvidia/opencv_3.1/opencv-3.1.0/modules/cudafeatures2d/src/cuda/orb.cu, line 148 terminate called after throwing an instance of 'cv::Exception' what(): /home/nvidia/opencv_3.1/opencv-3.1.0/modules/cudafeatures2d/src/cuda/orb.cu:148: error: (-217) invalid device symbol in function loadUMax** Aborted (core dumped) nvidia@tegra-ubuntu:~/project_wly$ 求教各位大神,怎麼解決這個問題?

no kernel image is available for execution on the device,计算能力不匹配的问题?

在运行网上下载的gipuma源码时遇到这个问题,以为是CUDA版本问题就换了笔记本试,源码核心的源文件见https://github.com/kysucix/gipuma/blob/master/gipuma.cu 笔记本:WIN10,VS2015,OPENCV2.4.13,CUDA9.0,显卡GTX950M,计算能力5.0,显卡驱动版本388.73 台式:WIN7家庭版,VS2015,OPENCV2.4.13,CUDA8.0,显卡QUADRO K2000,计算能力3.0,显卡驱动版本417.35 在网上查是code generation不对,其中-arch表示gpu architecture,于是在CMakeLists里将set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -gencode arch=compute_30,code=sm_30 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_61,code=sm_61) 笔记本里改成了set(CUDA_NVCC_FLAGS_RELEASE ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -arch=sm_50 -gencode=arch=compute_50,code=sm_50) 台式里改为了set(CUDA_NVCC_FLAGS_RELEASE ${CUDA_NVCC_FLAGS};-O3 --use_fast_math --ptxas-options=-v -std=c++11 --compiler-options -Wall -arch=sm_30 -gencode=arch=compute_30,code=sm_30) 结果还是不行,也换了其他所有可能的数字都不行,在CMake生成的工程属性页CUDA C/C++里也进行了修改(不知道对不对),也不行,求求各位帮忙看一下!可能问题有描述不清的地方,我会尽力解释的。PS:积分用完了,之后赚回来再悬赏吧

tensorflow 中文语音识别问题

#####tensorflow-gpu 1.12 + python3.6 + thchs30语音包 在执行以下代码时报错: ``` def speech_to_text(wav_file): wav, sr = librosa.load(wav_file, mono=True) mfcc = np.transpose(np.expand_dims(librosa.feature.mfcc(wav, sr), axis=0), [0, 2, 1]) logit = speech_to_text_network() saver = tf.train.Saver() with tf.Session() as sess: # 初始化 sess.run(tf.global_variables_initializer()) saver.restore(sess, tf.train.latest_checkpoint('./model')) decoded = tf.transpose(logit, perm=[1, 0, 2]) decoded, _ = tf.nn.ctc_beam_search_decoder(decoded, sequence_len, merge_repeated=False) # predict = tf.sparse_to_dense(decoded[0].indices, decoded[0].shape, decoded[0].values) + 1 # 执行到这一步的时候报错, output = sess.run(decoded, feed_dict={X: mfcc}) print(output) ``` - 报错信息 ``` WARNING:tensorflow:From E:/jupyter_project/yuyin_04/train.py:175: calling expand_dims (from tensorflow.python.ops.array_ops) with dim is deprecated and will be removed in a future version. Instructions for updating: Use the `axis` argument instead 2020-06-16 14:23:26.447367: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2020-06-16 14:23:26.612799: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1432] Found device 0 with properties: name: GeForce GTX 1660 Ti major: 7 minor: 5 memoryClockRate(GHz): 1.59 pciBusID: 0000:01:00.0 totalMemory: 6.00GiB freeMemory: 4.92GiB 2020-06-16 14:23:26.612963: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1511] Adding visible gpu devices: 0 2020-06-16 14:23:27.283154: I tensorflow/core/common_runtime/gpu/gpu_device.cc:982] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-06-16 14:23:27.283244: I tensorflow/core/common_runtime/gpu/gpu_device.cc:988] 0 2020-06-16 14:23:27.283291: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1001] 0: N 2020-06-16 14:23:27.283437: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 4651 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1660 Ti, pci bus id: 0000:01:00.0, compute capability: 7.5) 2020-06-16 14:23:32.282612: E tensorflow/stream_executor/cuda/cuda_dnn.cc:373] Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED 2020-06-16 14:23:32.283322: E tensorflow/stream_executor/cuda/cuda_dnn.cc:373] Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED Traceback (most recent call last): File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\client\session.py", line 1334, in _do_call return fn(*args) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\client\session.py", line 1319, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\client\session.py", line 1407, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [[{{node conv1d_0/conv1d/Conv2D}} = Conv2D[T=DT_FLOAT, data_format="NCHW", dilations=[1, 1, 1, 1], padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](conv1d_0/conv1d/Conv2D-0-TransposeNHWCToNCHW-LayoutOptimizer, conv1d_0/conv1d/ExpandDims_1)]] During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\ProgramData\Anaconda3\envs\python3.6\lib\contextlib.py", line 99, in __exit__ self.gen.throw(type, value, traceback) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\framework\ops.py", line 5229, in get_controller yield g File "E:/jupyter_project/yuyin_04/train.py", line 317, in speech_to_text output = sess.run(decoded, feed_dict={X: mfcc}) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\client\session.py", line 929, in run run_metadata_ptr) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\client\session.py", line 1152, in _run feed_dict_tensor, options, run_metadata) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\client\session.py", line 1328, in _do_run run_metadata) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\client\session.py", line 1348, in _do_call raise type(e)(node_def, op, message) tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [[node conv1d_0/conv1d/Conv2D (defined at E:/jupyter_project/yuyin_04/train.py:133) = Conv2D[T=DT_FLOAT, data_format="NCHW", dilations=[1, 1, 1, 1], padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](conv1d_0/conv1d/Conv2D-0-TransposeNHWCToNCHW-LayoutOptimizer, conv1d_0/conv1d/ExpandDims_1)]] Caused by op 'conv1d_0/conv1d/Conv2D', defined at: File "D:\Program Files\PyCharm 2019.3.3_pro\plugins\python\helpers\pydev\pydevd.py", line 2127, in <module> main() File "D:\Program Files\PyCharm 2019.3.3_pro\plugins\python\helpers\pydev\pydevd.py", line 2118, in main globals = debugger.run(setup['file'], None, None, is_module) File "D:\Program Files\PyCharm 2019.3.3_pro\plugins\python\helpers\pydev\pydevd.py", line 1427, in run return self._exec(is_module, entry_point_fn, module_name, file, globals, locals) File "D:\Program Files\PyCharm 2019.3.3_pro\plugins\python\helpers\pydev\pydevd.py", line 1434, in _exec pydev_imports.execfile(file, globals, locals) # execute the script File "D:\Program Files\PyCharm 2019.3.3_pro\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "E:/jupyter_project/yuyin_04/train.py", line 324, in <module> speech_to_text(wav_file) File "E:/jupyter_project/yuyin_04/train.py", line 306, in speech_to_text logit = speech_to_text_network() File "E:/jupyter_project/yuyin_04/train.py", line 205, in speech_to_text_network out = conv1d_layer(input_tensor=X, size=1, dim=n_dim, activation='tanh', scale=0.14, bias=False) File "E:/jupyter_project/yuyin_04/train.py", line 133, in conv1d_layer out = tf.nn.conv1d(input_tensor, W, stride=1, padding='SAME') + (b if bias else 0) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\util\deprecation.py", line 553, in new_func return func(*args, **kwargs) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\util\deprecation.py", line 553, in new_func return func(*args, **kwargs) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 2471, in conv1d data_format=data_format) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 1044, in conv2d data_format=data_format, dilations=dilations, name=name) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 787, in _apply_op_helper op_def=op_def) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\util\deprecation.py", line 488, in new_func return func(*args, **kwargs) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\framework\ops.py", line 3274, in create_op op_def=op_def) File "D:\ProgramData\Anaconda3\envs\python3.6\lib\site-packages\tensorflow\python\framework\ops.py", line 1770, in __init__ self._traceback = tf_stack.extract_stack() UnknownError (see above for traceback): Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [[node conv1d_0/conv1d/Conv2D (defined at E:/jupyter_project/yuyin_04/train.py:133) = Conv2D[T=DT_FLOAT, data_format="NCHW", dilations=[1, 1, 1, 1], padding="SAME", strides=[1, 1, 1, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/device:GPU:0"](conv1d_0/conv1d/Conv2D-0-TransposeNHWCToNCHW-LayoutOptimizer, conv1d_0/conv1d/ExpandDims_1)]] Process finished with exit code -1 ```

OPencv使用下cvtColor 出错

环境:树莓派3 raspberry 代码片段: import cv2 import numpy as np cap = cv2.VideoCapture(0) faceCasecade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") while(True): ret,frame = cap.read() gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) faces = faceCascade.detectMultiscale( gray, scaleFactor=1.2, minNeighbors = 5, minSize = (30, 30) ) print("Found {0} faces!".format(len(faces))) for(x, y, w, h) in faces: cv2.rectangele(frame,(x,y),(x+w,y+h),(0,255,0),2) cv.inshow('frame',frame) if cv2.waitKey(1)& 0xFF ==ord('q'): break cap.release() cv2.destroyAllwindows() 报错: Traceback (most recent call last): File "/home/pi/Desktop/OPenCV/live.py", line 11, in <module> gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) cv2.error: OpenCV(3.4.3) /home/pi/opencv-3.4.3/modules/imgproc/src/color.cpp:181: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor' 如何解决

opencv配置在qt5.6上的问题

通过cmake 3.7.2 Configure OpenCV3.2的source文件遇到以下问题: Make Error at D:/pack/opencv/cmake-3.7.2-64位/cmake-3.7.2-win64-x64/share/cmake-3.7/Modules/CMakeTestCXXCompiler.cmake:44 (message): The C++ compiler "D:/qtcreator/Tools/mingw492_32/bin/g++.exe" is not able to compile a simple test program. It fails with the following output: Change Dir: D:/pack/opencv/release/CMakeFiles/CMakeTmp Run Build Command:"D:/qtcreator/Tools/mingw492_32/bin/mingw32-make.exe" "cmTC_97ee7/fast" D:/qtcreator/Tools/mingw492_32/bin/mingw32-make.exe -f CMakeFiles\cmTC_97ee7.dir\build.make CMakeFiles/cmTC_97ee7.dir/build mingw32-make.exe[1]: Entering directory 'D:/pack/opencv/release/CMakeFiles/CMakeTmp' CMakeFiles\cmTC_97ee7.dir\build.make:64: recipe for target 'CMakeFiles/cmTC_97ee7.dir/testCXXCompiler.cxx.obj' failed process_begin: CreateProcess(NULL, D:\pack\opencv\cmake-3.7.2-64位\cmake-3.7.2-win64-x64\bin\cmake.exe -E cmake_echo_color --switch= --progress-dir=D:\pack\opencv\release\CMakeFiles\CMakeTmp\CMakeFiles --progress-num=1 "Building CXX object CMakeFiles/cmTC_97ee7.dir/testCXXCompiler.cxx.obj", ...) failed. make (e=2): 系统找不到指定的文件。 mingw32-make.exe[1]: *** [CMakeFiles/cmTC_97ee7.dir/testCXXCompiler.cxx.obj] Error 2 mingw32-make.exe[1]: Leaving directory 'D:/pack/opencv/release/CMakeFiles/CMakeTmp' makefile:125: recipe for target 'cmTC_97ee7/fast' failed mingw32-make.exe: *** [cmTC_97ee7/fast] Error 2 CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:98 (project)

cuda 9.2在VS2015中的编译问题

我用cuda写了一个.cu的文件,准备封装编译成dll,但始终无法编译成功,频繁 报 expected a ">>>", expected a "(",expected an expression, too few arguments in function call等错误,貌似核函数根本没有被编译器识别。 最后提示错误MSB3721 命令“"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env -ccbin "D:\Visual Studio\VC\bin\x86_amd64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -DWIN32 -DWIN64 -DNDEBUG -D_CONSOLE -D_WINDLL -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /FS /Zi /MD " -o x64\Release\cmusimulator.cu.obj "C:\Users\lone\Desktop\cmusimulator_gpu\cmusimulator\cmusimulator.cu"”已退出,返回代码为 1。 求各位大神帮助,十分感激!

matlab调用cuda 中cublas的问题

mul3.obj : error LNK2019: 无法解析的外部符号 cublasCreate_v2,该符号在函数 mexFunction 中被引用 mul3.obj : error LNK2019: 无法解析的外部符号 cublasDestroy_v2,该符号在函数 mexFunction 中被引用 mul3.obj : error LNK2019: 无法解析的外部符号 cublasSgemm_v2,该符号在函数 mexFunction 中被引用 mul3.mexw64 : fatal error LNK1120: 3 个无法解析的外部命令 **总是报错,在VS2015里面可以成功调用cublas进行矩阵乘法计算,但是在mexcuda里面调用总是报错,不知道什么原因,求大神指点迷津!**

tensorflowGPU安装出现ImportError

win10+1080ti+CUDA9.0.176+cuDnn7.0.5+VS2015 使用anaconda3-5.1.0安装python版本为3.5.4,tensorflowGPU1.5, import tensorflow 出现如下错误。该如何解决? ImportError: DLL load failed: 找不到指定的模块。 ImportError: No module named '_pywrap_tensorflow_internal' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "D:\Programs\Anaconda3\envs\tensorflow_gpu\lib\site-packages\tensorflow\__init__.py", line 24, in <module> from tensorflow.python import * File "D:\Programs\Anaconda3\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module> from tensorflow.python import pywrap_tensorflow File "D:\Programs\Anaconda3\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module> raise ImportError(msg) ImportError: Traceback (most recent call last): File "D:\Programs\Anaconda3\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 18, in swig_import_helper return importlib.import_module(mname) File "D:\Programs\Anaconda3\envs\tensorflow_gpu\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 985, in _gcd_import File "<frozen importlib._bootstrap>", line 968, in _find_and_load File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 666, in _load_unlocked File "<frozen importlib._bootstrap>", line 577, in module_from_spec File "<frozen importlib._bootstrap_external>", line 938, in create_module File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed ImportError: DLL load failed: 找不到指定的模块。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\Programs\Anaconda3\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module> from tensorflow.python.pywrap_tensorflow_internal import * File "D:\Programs\Anaconda3\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 21, in <module> _pywrap_tensorflow_internal = swig_import_helper() File "D:\Programs\Anaconda3\envs\tensorflow_gpu\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 20, in swig_import_helper return importlib.import_module('_pywrap_tensorflow_internal') File "D:\Programs\Anaconda3\envs\tensorflow_gpu\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: No module named '_pywrap_tensorflow_internal' Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace above this error message when asking for help. >>>

ninja 和 VS2015编译caffe-windows失败

![失败截图](https://img-ask.csdn.net/upload/201807/15/1531650930_543226.png) 失败提示 Determining if the C compiler works failed with the following output: Change Dir: G:/Git/caffe/scripts/build/CMakeFiles/CMakeTmp Run Build Command:"C:/Users/TAO/Anaconda3/Library/bin/ninja.exe" "cmTC_55e72" [1/2] Building C object CMakeFiles\cmTC_55e72.dir\testCCompiler.c.obj [2/2] Linking C executable cmTC_55e72.exe FAILED: cmTC_55e72.exe cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=CMakeFiles\cmTC_55e72.dir --manifests -- C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\link.exe /nologo CMakeFiles\cmTC_55e72.dir\testCCompiler.c.obj /out:cmTC_55e72.exe /implib:cmTC_55e72.lib /pdb:cmTC_55e72.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." RC Pass 1: command "rc /foCMakeFiles\cmTC_55e72.dir/manifest.res CMakeFiles\cmTC_55e72.dir/manifest.rc" failed (exit code 0) with the following output: The system cannot find the file specified ninja: build stopped: subcommand failed. 我的脚本是 :: Change the settings here to match your setup :: Change MSVC_VERSION to 12 to use VS 2013 if NOT DEFINED MSVC_VERSION set MSVC_VERSION=14 :: Change to 1 to use Ninja generator (builds much faster) if NOT DEFINED WITH_NINJA set WITH_NINJA=1 :: Change to 1 to build caffe without CUDA support if NOT DEFINED CPU_ONLY set CPU_ONLY=0 :: Change to generate CUDA code for one of the following GPU architectures :: [Fermi Kepler Maxwell Pascal All] if NOT DEFINED CUDA_ARCH_NAME set CUDA_ARCH_NAME=Auto :: Change to Debug to build Debug. This is only relevant for the Ninja generator the Visual Studio generator will generate both Debug and Release configs if NOT DEFINED CMAKE_CONFIG set CMAKE_CONFIG=Release :: Set to 1 to use NCCL if NOT DEFINED USE_NCCL set USE_NCCL=0 :: Change to 1 to build a caffe.dll if NOT DEFINED CMAKE_BUILD_SHARED_LIBS set CMAKE_BUILD_SHARED_LIBS=0 :: Change to 3 if using python 3.5 (only 2.7 and 3.5 are supported) if NOT DEFINED PYTHON_VERSION set PYTHON_VERSION=3 :: Change these options for your needs. if NOT DEFINED BUILD_PYTHON set BUILD_PYTHON=1 if NOT DEFINED BUILD_PYTHON_LAYER set BUILD_PYTHON_LAYER=1 if NOT DEFINED BUILD_MATLAB set BUILD_MATLAB=0 :: If python is on your path leave this alone if NOT DEFINED PYTHON_EXE set PYTHON_EXE=python :: Run the tests if NOT DEFINED RUN_TESTS set RUN_TESTS=0 :: Run lint if NOT DEFINED RUN_LINT set RUN_LINT=0 :: Build the install target if NOT DEFINED RUN_INSTALL set RUN_INSTALL=0 折腾一个星期也没弄出来,请大神帮忙看下,谢谢

cmake编译opencv3.2+opencv_contrib一直报错。。

一直会提示这个错,有大神知道原因吗,我把一些依赖包下载下来放固定目录里了。还是该提醒还提醒错。我用的是opencv3.2+vs2015。 CMake Error at H:/OpenCV/opencv/sources/cmake/OpenCVUtils.cmake:1005 (file): file MD5 failed to read file "H:/OpenCV/Library/3rdparty/protobuf/": Permission denied Call Stack (most recent call first): H:/OpenCV/opencv_contrib-master/modules/dnn/cmake/OpenCVFindLibProtobuf.cmake:32 (ocv_download) H:/OpenCV/opencv_contrib-master/modules/dnn/CMakeLists.txt:5 (include)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/11.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/003/monkey/5.gif)

'import theano'出错,网上找不到类似情况,崩溃

非计算机专业,对编码一无所知,纯粹根据网络教程安装theano,半个多月了,一直失败,提示的出错在网上找不到类似情况,崩溃。。。 由于使用笔记本版本较老,所以在软件使用方面没什么选择余地, 系统,win7+32位 cuda 5.0 anaconda3 python3.7(anaconda自带下载安装)。 与theano相关的pachages都下载了,下载方法使用conda install,包的版本基本都是最新的。 与theano相关的部分包: anaconda 2018.12 balas 1.0 libgpuarray 0.7.6 libpython 2.1 m2w64-toolchain 5.3.0 mkl 2019.1 mkl-service 1.1.2 nose 1.3.7 numpy 1.15.4 python 3.7.1 scipy 1.1.0 theano 1.0.3 .theanorc.txt: [global] openmp=False floatX = float32 device = cuda fastmath = True [gcc] cxxflags = -IC:\ProgramData\Anaconda3\MinGW [nvcc] flags=-LC:\ProgramData\Anaconda3_\libs compiler__bindir=C:\Program Files\Microsoft Visual Studio 8\VSTA\Bin [blas] ldflags= [cuda] root = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0_ 目前状况: import pygpu 正常,cuda安装正常, import theano一直提示出错,快半个月了,网上各种方法都试过了,包括各种比如重启,theano cache purge。环境变量已添加,pathopathy添加后会出现configparser的问题,所以没加。 现在import theano提示: error (theano.gpuarray):could not initialize pygpu,support disabled traceback, ....... 最后的错误显示: pygpu.gpuarray.gpuarrayexception: b'could not load "cuGetErrorName":\xd5\xd2\xb2\xbb\xb5\xbd\xd6\xb8\xb6\xa8\xb5\xc4\xb3\xcc\xd0\xf2\xa1\xa3\r\n' 网上找不到类似的错误,请教各位专家,有什么办法吗??

2019 Python开发者日-培训

2019 Python开发者日-培训

150讲轻松搞定Python网络爬虫

150讲轻松搞定Python网络爬虫

设计模式(JAVA语言实现)--20种设计模式附带源码

设计模式(JAVA语言实现)--20种设计模式附带源码

YOLOv3目标检测实战:训练自己的数据集

YOLOv3目标检测实战:训练自己的数据集

java后台+微信小程序 实现完整的点餐系统

java后台+微信小程序 实现完整的点餐系统

三个项目玩转深度学习(附1G源码)

三个项目玩转深度学习(附1G源码)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

初级玩转Linux+Ubuntu(嵌入式开发基础课程)

2019 AI开发者大会

2019 AI开发者大会

玩转Linux:常用命令实例指南

玩转Linux:常用命令实例指南

一学即懂的计算机视觉(第一季)

一学即懂的计算机视觉(第一季)

4小时玩转微信小程序——基础入门与微信支付实战

4小时玩转微信小程序——基础入门与微信支付实战

Git 实用技巧

Git 实用技巧

Python数据清洗实战入门

Python数据清洗实战入门

使用TensorFlow+keras快速构建图像分类模型

使用TensorFlow+keras快速构建图像分类模型

实用主义学Python(小白也容易上手的Python实用案例)

实用主义学Python(小白也容易上手的Python实用案例)

程序员的算法通关课:知己知彼(第一季)

程序员的算法通关课:知己知彼(第一季)

MySQL数据库从入门到实战应用

MySQL数据库从入门到实战应用

机器学习初学者必会的案例精讲

机器学习初学者必会的案例精讲

手把手实现Java图书管理系统(附源码)

手把手实现Java图书管理系统(附源码)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

极简JAVA学习营第四期(报名以后加助教微信:eduxy-1)

.net core快速开发框架

.net core快速开发框架

玩转Python-Python3基础入门

玩转Python-Python3基础入门

Python数据挖掘简易入门

Python数据挖掘简易入门

微信公众平台开发入门

微信公众平台开发入门

程序员的兼职技能课

程序员的兼职技能课

Windows版YOLOv4目标检测实战:训练自己的数据集

Windows版YOLOv4目标检测实战:训练自己的数据集

HoloLens2开发入门教程

HoloLens2开发入门教程

微信小程序开发实战

微信小程序开发实战

Java8零基础入门视频教程

Java8零基础入门视频教程

相关热词 c# 解析cad c#数字格式化万 c#int转byte c#格式化日期 c# wpf 表格 c# 实现ad域验证登录 c#心跳包机制 c#使用fmod.dll c#dll vb 调用 c# outlook
立即提问
相关内容推荐