DNN classify function uses GPU, or just CPU ?

Illustration
Alessandro - 2023-12-07T22:19:09+00:00
Question: DNN classify function uses GPU, or just CPU ?

I have been using Deep Learning for a short time; I learned to use the GPU for network training.   When I trained the neural network, I use the classify function to make it "work" on the images that the network has to classify.   Does anyone know whether, in this working phase, "classify" uses GPU or CPU ?   I couldn't find any information in the documentation, and the CPU/GPU setting that sets the training seems to me to have no effect in the working phase.

Expert Answer

Profile picture of Neeta Dsouza Neeta Dsouza answered . 2025-11-20

Classify will automatically choose GPU (if it is available and suitable).
 
You can also specify the use of GPU explicitly:
classify(net, X, 'ExecutionEnvironment', 'gpu');  
% Available options: 'auto', 'gpu', 'cpu', 'multi-gpu', 'parallel'
% default is 'auto'

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!