如何强制MATLAB在CPU而不是GPU上运行深度学习代码?

时间:2016-05-18 21:19:11

标签: matlab compilation deep-learning

我没有启用CUDA启用的Nvidia GPU,我想强制MATLAB在CPU而不是GPU上运行代码(是的,我知道,它会非常慢)。我该怎么办?

举个例子,让我们尝试在没有CUDA的情况下在我的电脑上运行this code。这是MATLAB给出的错误:

There is a problem with the CUDA driver or with this GPU device. Be sure that you have a supported GPU and that the latest driver is installed.

Error in nnet.internal.cnn.SeriesNetwork/activations (line 48) 
output = gpuArray(data); 

Error in SeriesNetwork/activations (line 269) 
YChannelFormat = predictNetwork.activations(X, layerID); 

Error in DeepLearningImageClassificationExample (line 262) 
trainingFeatures = activations(convnet, trainingSet, featureLayer, ... 

Caused by: 
The CUDA driver could not be loaded. The library name used was 'nvcuda.dll'. The error was: 
The specified module could not be found.

2 个答案:

答案 0 :(得分:1)

使用R2016a,ConvNet“功能需要Parallel Computing Toolbox™和支持CUDA®的NVIDIA®GPU,计算能力为3.0或更高。”

请参阅:http://uk.mathworks.com/help/nnet/convolutional-neural-networks.html

答案 1 :(得分:-1)

您链接的代码示例需要GPU。因此,解决方案非常简单:

您需要使用不同的代码。

在你的问题中没有具体提到你想要达到的目标,所以很难说你是否需要创造自己的东西或者能够获得现有的解决方案,但是{{3}可能是一种灵感。