필터 지우기
필터 지우기

How to chose convolutional network size to fit in memory?

조회 수: 3 (최근 30일)
Denys Li
Denys Li 2017년 8월 11일
댓글: Mity sosi 2019년 5월 11일
Hi,
I am trying to use NN toolbox with convolutional layer for regression problem, specifically depth estimation from image. For this, I want to use 256x256 as input and kind of smaller size for output but still can't fit into RAM. What i need to do to chose best sizes of layers?
Another question, why I cant use datastores(without loading images into RAM) with Regression Layer?
Thanks for attention
  댓글 수: 1
Mity sosi
Mity sosi 2019년 5월 11일
Hi
Can you expalin how to define ' your regressors in the other columns ' , I do not know it . because I have the same problem.
Thanks

댓글을 달려면 로그인하십시오.

채택된 답변

Amy
Amy 2017년 8월 14일
Hi Denys,
See https://www.mathworks.com/help/nnet/ug/layers-of-a-convolutional-neural-network.html for information on defining layers for your convolutional neural network.
In a CNN, the majority of the weights are held by the fully connected layers. The convolutional layers in the network convert spatial information into more compact semantic information. Pooling layers then downsample redundant information so that when you reach fully connected layers they are receiving fewer activations.
I am not sure what your CNN looks like, but if you have fewer convolutional layers in your network, your last fully connected layer ends up with a greater number of weights. This could be what is causing you to run out of RAM.
As an example, you could refer to the layers in the AlexNet network for ideas for defining your network layers: https://www.mathworks.com/help/nnet/examples/visualize-features-of-a-convolutional-neural-network.html
As for using image datastores, you can use them with a regression layer without loading them into memory. For now, you can get the image file names from the datastore, then create a table with the file names in the first column and your regressors in the other columns, and feed that to trainNetwork.
  댓글 수: 3
Chee Ho Ng
Chee Ho Ng 2017년 12월 27일
편집: Chee Ho Ng 2017년 12월 27일
Hello Ms.Amy, I found your answer helpful too. I got a related further question:
Do Matlab have any function that can calculate the required memory for a CNN? In my case, I'm training with GPU.
This can help user predict how much RAM is needed for a CNN design.
Since we have define our layers for CNN, I hope there is a function that can save user time for manual calculation.
Hope to hear from you. Thank you in advance!
Mity sosi
Mity sosi 2019년 5월 11일
Dear Amy,
Can you expalin how to define ' your regressors in the other columns ' , I do not know it .
Thanks

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Mity sosi
Mity sosi 2019년 5월 11일
Dear Amy,
Can you expalin how to define ' your regressors in the other columns ' , I do not know it .
Thanks

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by