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

3 次查看(过去 30 天)
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:

采纳的回答

Joss Knight
Joss Knight 2024-4-22
编辑:Joss Knight 2024-4-22

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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by