Training a convolutional neural network (CNN) for image classification, I successfully used the trainNetwork function employing 4 CPU cores. However, the process takes quite a lot of time (hours) and must be accelerated, e.g by using a graphics card.
Currently, I pass a tbl to trainNetwork containing the image paths and labels. I suppose that images are read from the disk and then sequentially processed by the function. This might work for CPU based processing system to some extent. However, using a GPU, I assume that this approach will significantly slow down the training process due to a number of GPU accesses and related delays. Is it e.g. possible to transfer the training data batch-wise to the graphics card or is this automatically done using the parallel processing toolbox? How do I have to adapt my code in this case? It would be great to have a minimalistic code snippet.
Thank you! Best, Stephan
P.S.: I should mention that I cannot use an imageDatastore, since this datatype apparently does not work for regression CNNs which I use.