MATLAB CUDNN_STATUS_EXECUTION_FAILED

问题:

环境:

  • Windows 10
  • Matlab2018b
  • gpuDevice: GeForce RTX 2080 Ti
  • nvcc --version: Cuda compilation tools, release 10.2, V10.2.89

matlab 运行Deep Learning Toolbox Model for AlexNet Network 代码 报错

net = alexnet
layer = 'conv1'
channels = 1:36
I = deepDreamImage(net,layer,channels,...
    'PyramidLevels',1,...
    'Verbose',0)

figure
for i = 1:36
    subplot(6,6,i)
    imshow(I(:,:,:,i))
end

代码来自博客:如何可视化卷积神经网络特征(基于matlab R2018b)

警告: The CUDA driver must recompile the GPU libraries because your device is more recent than the libraries. Recompiling can take several minutes. Learn more.
错误使用 nnet.internal.cnngpu.convolveForward2D
Unexpected error calling cuDNN: CUDNN_STATUS_EXECUTION_FAILED.

解决

方法1:

在matlab命令行输入:

>> gpuDevice

ans = 

  CUDADevice - 属性:

                      Name: 'GeForce RTX 2080 Ti'
                     Index: 1
         ComputeCapability: '7.5'
            SupportsDouble: 1
             DriverVersion: 10.2000
>> nvcc --version
未定义函数或变量 'nvcc'。

在matlab中配置CUDA环境变量

操作:
点击:主页设置路径添加文件夹,选择下面两个路径:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\libnvvp
添加完成后点击保存。
添加环境变量

之后再次运行代码,可以成功运行啦。
结果图

方法2:(玄学但是有用…)

在代码中随意添加一行:将0.0001存入GUP中,之后再重新运行net = trainNetwork( ),不会出现报错问题。

ile = gpuArray(0.0001);

net = trainNetwork(XTrain,YTrain,lgraph_1,options);

参考网址:https://www.mathworks.com/matlabcentral/answers/391368-cudnn-error-on-surface-book-2-when-running-cnn-example?s_tid=srchtitle

  • 16
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 17
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 17
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值