Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA out of memory error #10

Closed
Karami-m opened this issue Aug 11, 2022 · 2 comments
Closed

CUDA out of memory error #10

Karami-m opened this issue Aug 11, 2022 · 2 comments

Comments

@Karami-m
Copy link

Hi,

Thanks for making the code available for such an interesting work.

I have tried to train the Relation Prediction model on GPUs with 32 GB of memory but it lead to CUDA out of memory error. I have also tried to train with vgg16(pretrain=True) but still ran into the same problem. So, I wonder what kind of GPU you used for your experiments and how you manage the memory in training.

@Karami-m
Copy link
Author

The problem was solved by adding the following to the run.py file:

import tensorflow as tf  
gpus = tf.config.experimental.list_physical_devices('GPU')  
for gpu in gpus:  
    tf.config.experimental.set_memory_growth(gpu, True)

@larksq
Copy link
Contributor

larksq commented Aug 23, 2022

We used NVIDIA 3080 or sometimes the NVIDIA A10 for training. Usually changing the train_batch_size to a smaller value helps with the out-of-memory error problem. I am glad you found a solution that worked for you, hence your error might be related to a different version of TensorFlow.

@larksq larksq closed this as completed Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants