How do I force MATLAB to run deep learning code on

2019-06-14 23:23发布

I don't have CUDA-enabled Nvidia GPU, and I want to force MATLAB to run the code on CPU instead of GPU (yes, I know, it will be very very slow). How can I do it?

As an example, let’s try to run this code on my PC without CUDA. Here is the error given by 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条回答
欢心
2楼-- · 2019-06-15 00:00

With R2016a, the ConvNet "functionality requires the Parallel Computing Toolbox™ and a CUDA®-enabled NVIDIA® GPU with compute capability 3.0 or higher."

See: http://uk.mathworks.com/help/nnet/convolutional-neural-networks.html

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2019-06-15 00:07

The code example that you link to requires a GPU. As such the solution is very simple:

You need to use different code.

In your question it is not mentioned specifically what you are trying to achieve, so it is hard to say whether you would need to create something your self or will be able to pick up an exisiting solution, but this CPU vs GPU deep learning benchmark may be an inspiration.

查看更多
登录 后发表回答