MATLAB Answers

How to run "Train a Convolutional Neural Network for Regression" example in single precision on laptop with NVIDIA GPU?

7 views (last 30 days)
Kenneth Yip
Kenneth Yip on 21 Feb 2018
Answered: Joss Knight on 9 Mar 2018
Attempt 1: Use nndata2gpu: error only works for 2D array >> trainImagesSingle = nndata2gpu(trainImages,'single'); Error using nnsize (line 32) Data{1,1} is not two-dimensional.
Error in nndata2gpu (line 76) [N,Q,TS,M] = nnsize(x);
Attempt 2: Use 'single': runs but no improvement in training time >> trainImagesSingle = single(trainImages); >> trainAnglesSingle = single(trainAngles); >> net = trainNetwork(trainImagesSingle,trainAnglesSingle,layers,options);
It seems like it would be a fairly common thing to do since most laptop Nvidia gpu's (mine is Quadro M1200) have slow double precision.
Any idea?

  0 Comments

Sign in to comment.

Answers (1)

Joss Knight
Joss Knight on 9 Mar 2018
Laptop GPUs are severely limited in power and performance and are often no better for compute than the CPU, even in single precision. Try running GPU Bench to see if you can fairly expect your GPU to perform well.

  0 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!