Clear Filters
Clear Filters

Why training stops showing error (out of memory) during implementing transfer learning with pre-trained network despite having a laptop of well configuration?

1 view (last 30 days)
Trying to use trasnfer learning method for classsify images but I have failed to run. It always stop showing error: out of memory. I have faced the same problem when I have tried to build a large and complex cnn architecture from scratch. At first I have thought that too large dataset caused the problem.I have tried my model with only few images to test and even have tried to run in better configured pc than my laptop also, but I couln't get rid of the problem. Now I am facing the same issue while trying transfer learing. I do need both runinng a complex network from scratch and using pre-trained network.
I have follwed the documentation of transfer learning using the Prepare Network for Transfer Learning Using Deep Network Designer.
The details of images, choosen pre-trained methods and pc confuguration are:
images no: 60,000
class of image: 13
pre-trained network: DenseNet-201
laptop configuration: Ryzen 7, RAM 16GB, GPU NVIDIA GEFORCE RTX 3050
I am also attaching the Error msg showing and gpu details from gpuDevice:

Accepted Answer

Joss Knight
Joss Knight on 22 Apr 2024
Edited: Joss Knight on 22 Apr 2024

You have a very small GPU I'm afraid. You need to lower your MiniBatchSize until it works. Also, set your ExecutionEnvironment to auto since you only have one GPU.

If this doesn't work your only option is to use a smaller network or a bigger GPU.

You could just train on the CPU of course, if you don't mind it taking longer. At least that will likely have plenty of memory, and the way GPUs tend to be throttled on laptops it probably won't be much slower.

More Answers (0)

Categories

Find more on Image Data Workflows in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!