MATLAB: Is there no ‘ExecutionEnvironment’ parameter for trainingOptions function

neural networktrainingoptions

I am using a macbook pro with no nvida gpu, by default trainNetwork should use cpu instead of gpu. But I got this 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 parallel.internal.gpu.isAnyDeviceSelected
Error in parallel.gpu.GPUDevice.current (line 33)
if parallel.internal.gpu.isAnyDeviceSelected
Error in gpuDevice (line 23)
dev = parallel.gpu.GPUDevice.current();
Caused by:
The CUDA driver could not be loaded. The library name used was '/usr/local/cuda/lib/libcuda.dylib'. The error
was:
dlopen(/usr/local/cuda/lib/libcuda.dylib, 10): image not found"
Then I tried to follow the documentation to use cpu https://www.mathworks.com/help/nnet/ref/trainingoptions.html , my matlab 2016a says trainingOptions doesn't have 'ExecutionEnvironment' parameter.
This is my code
opts = trainingOptions('sgdm',...
'ExecutionEnvironment','cpu',...
'LearnRateSchedule','piecewise',...
'LearnRateDropFactor',0.2,...
'LearnRateDropPeriod',5,...
'MaxEpochs',20,...
'MiniBatchSize',300);
Error using nnet.cnn.TrainingOptionsSGDM.parseInputArguments (line 115)
'ExecutionEnvironment' is not a recognized parameter. For a list of valid name-value pair arguments, see the
documentation for this function.
Error in trainingOptions (line 97)
args = nnet.cnn.TrainingOptionsSGDM.parseInputArguments(varargin{:});

Best Answer

I got the same error. I think depend on the Matlab version, I am using matlab2016a. Can someone help us?