1

how can I run this example in my pc? I don't have Nvidia graphic cards so I cannot use Cuda in Matlab.

I need to do it with Matlab because half of the my code is written in Matlab and all variables are in Matlab format.

My PC has ATI Radeon HD 4530 graphic card.

I read this page, but it is still confusing to understand which one is suitable.

Update1: I want to Train a deep neural network for image classification. A task similar to this example.

Update2: When I run the code mentioned in Update1, it gives me following error:

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.
Sadegh
  • 865
  • 1
  • 23
  • 47
  • I am sure it can be done, but I don't understand what you want to do. What library are you planning to use? Does it support Open CL? Do you need GPU acceleration? Would running it on the CPU only be an alternative? – Daniel May 16 '16 at 21:41
  • I want to Train a deep neural network for image classification. A task similar to this example: http://it.mathworks.com/help/nnet/examples/training-a-deep-neural-network-for-digit-classification.html?searchHighlight=deep%20learning – Sadegh May 16 '16 at 21:45
  • I don't have any specific library in mind, I just like to make it run in Matlab. I dont need GPU acceleration (but can be good if it works :-) ) – Sadegh May 16 '16 at 21:46
  • I changed the link to other matlab's example which is more suitable – Sadegh May 16 '16 at 22:02
  • As suggested, I asked the question about running the code separately : http://stackoverflow.com/questions/37310280/how-to-force-matlab-to-run-a-deep-learning-code-on-cpu-instead-of-gpu – Sadegh May 19 '16 at 06:18
  • MATLAB only supports NVIDIA GPUs. The only other option would be to write the GPU code yourself and compile with MEX, but anything MATLAB does (`gpuArray`) will only work with NVIDIA – Ander Biguri Oct 05 '16 at 09:18

2 Answers2

0

Yes you can. You will have to create DLL's and use OpenCL. Look into S-Functions and Mex.

Check the documentation

There are third party tools that you may be able to use. I personally have never tried it.

Possible Tool

Makketronix
  • 1,389
  • 1
  • 11
  • 31
  • Why S-Functions? As far as I understand no Simulink is involved here. – Daniel May 16 '16 at 21:39
  • Look into mex functions then :) – Makketronix May 16 '16 at 21:42
  • thanks for answer. I don't know how much effort it needs to apply your solution. I am loooking for an easy to perform and understand solution( same discussion you have [in your website](http://www.makketronix.com/sites/default/files/inline-images/UnitSquare_1.png). I tried to ask my question in different way (refer to update2 inside my question): how you run matlab example with your method? – Sadegh May 16 '16 at 21:52
  • Ah, I see. I don't think that Mathworks support OpenCL at this point. They list NVIDIA GPU as hardware requirements. I will update my answer to a possible third party tool. – Makketronix May 16 '16 at 22:02
0

MatConvNet -> Work both on CPU and GPU.

MatConvNet is a MATLAB toolbox implementing Convolutional Neural Networks (CNNs) for computer vision applications. It is simple, efficient, and can run and learn state-of-the-art CNNs. Many pre-trained CNNs for image classification, segmentation, face recognition, and text detection are available.

Another option: Caffe in general and Openmp variant of caffe in particular support Matlab and work both on CPU and GPU

Sadegh
  • 865
  • 1
  • 23
  • 47