KamitaniLab / dnn-feature-decoding

4 stars 0 forks source link

memory error #1

Closed fatemehkalantari1993 closed 1 year ago

fatemehkalantari1993 commented 2 years ago

I use 40GB RAM to run your code, and I also run the training part for each layer separately, but since the size of the image features is very high (especially in the initial layers), I am facing a memory error. What was the RAM of your system to run this code (featdec_deeprecon_500voxel_vgg19_allunits_fastl2lir_alpha100_train)??? If I want to reduce the number of units in each layer, how should I do it? I don't understand how you can select a single group per layer. I used a pre-trained VGG (imagenet-vgg-verydeep-19.mat) and MatConvNet for image features.

mitsuaki commented 2 years ago

Currently, huge number of units are processed at once per layer, so it requires more than 100GB RAM. You can modify this to deal with small number of units at a time because all units are independent (, but there is no such option in our code, so you must write that code yourself). Specifically, the y at 166th line of the code is the size of the number of samples x number of units (e.g., y.shape for the conv1_1 layer might be (1200, 64, 224,224)), so you can select arbitrary units from y (e.g., like y = y[:, 0:10,0,0]) to train.

fatemehkalantari1993 commented 2 years ago

Hi,

​Thank you very much for your help,

You wrote in the paper that you chose 1000 units. This 1000 unit is selected from (64224224) units.

I hope I have made my aim clear, what combination did you use to choose 1000 units??? These questions are to match my results with yours.

On Wed, 09/07/2022 02:30 PM, mitsuaki @.***> wrote:

Currently, huge number of units are processed at once per layer, so it requires more than 100GB RAM.

You can modify this to deal with small number of units at a time because all units are independent (, but there is no such option in our code, so you must write that code yourself).

Specifically, the y at 166th line of the code is the size of the number of samples x number of units (e.g., y.shape for the conv1_1 layer might be (1200, 64, 224,224)), so you can select arbitrary units from y (e.g., like y = y[:, 0:10,0,0]) to train. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

[ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "https://github.com/KamitaniLab/dnn-feature-decoding/issues/1#issuecomment-1239177498", "url": "https://github.com/KamitaniLab/dnn-feature-decoding/issues/1#issuecomment-1239177498", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ] -- This email was Anti Virus checked by Security Gateway.