YuxiangRen / Heterogeneous-Deep-Graph-Infomax

HDGI code
59 stars 14 forks source link

out of memory #7

Closed 960924 closed 4 years ago

960924 commented 4 years ago

Hi, I am excited to see this work. But when I trained the HDGI-HGAT model with GTX-1080ti GPU, I got the following error: RuntimeError: CUDA out of memory. Tried to allocate 146.88 MiB (GPU 0; 2.00 GiB total capacity; 374.63 MiB already allocated; 0 bytes free; 1015.00 KiB cached) Is there any solution? Looking forward to your reply.

YuxiangRen commented 4 years ago

The memory capacity of the GPU I used is 11GB. You have two ways to run the code. 1, Use the smaller hidden layer dimension ( including Number of hidden units and Number of semantic level hidden units) or use less attention heads. You can deduct the memory requirement in this way, but it may affect the performance of the model. 2, You can disable the CUDA training and run the model with the CPU setting. But it may result in slow training. When I conduct experiments with large dimensions and more attention heads, CUDA out of memory occurs as well. Finally, I choose to train the model in CPU.

If you have any other questions, just let me know.

xinchen1412 commented 4 years ago

The "The dimension of node-level representations in HDGI-C is set as 512. For HDGI-A, we set the dimension of node-level representations as 64 and the attention head is set as 4. " mentioned in your paper, don't these two dimensions need to be the same? As you mentioned above, performance depends on the values of those parameters

YuxiangRen commented 4 years ago

You are right. For a fair comparison, we should keep the dimensions of latent features exact same. But the attention mechanism is time-consuming, so we can't finish the experiments HDGI-A with dimension size 512 when proposing the paper.