-
Notifications
You must be signed in to change notification settings - Fork 19.5k
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
Allowing GPU memory growth command does not work #11584
Comments
Can you please try the following at the top of your code: import keras
gpu_options = tf.GPUOptions(allow_growth=True)
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))
keras.backend.tensorflow_backend.set_session(sess) |
Can confirm this is. Keras v2.2.4 I am using:
Also the Errors in:
If I remove Also @omalleyt12 that solution, I just tested and it didnt work for me. |
@kevupton The code below does not work for me from keras import backend as K |
@Schiboni
|
@kevupton |
hmmm I think I had a stuck scenario one time, but I cannot remember how I fixed it. How long is it stuck for, before you retry ? |
It can be stuck uninterruptedly for hours, no upper bound. |
are you compiling your own model ? Like |
Yes, of course: print("[INFO] training with {} GPUs...".format(ngpus)) |
@omalleyt12 I have this problem too. It seems gpu_options.allow_growth doesn't work together with gpu_options.per_process_gpu_memory_fraction. Here is my code: |
Does anybody solve this problem?? |
You can try |
@buivancuong Thanks for the suggstion, I tried this too...also not working for me:
|
Hello! I have the same problem `config=tf.compat.v1.ConfigProto(log_device_placement=True)
As a result: 40% CPU, 97% Physical memory and 2% GPU |
why is the issue closed if the problem is unsolved?? |
Hi, i have a memory problem.
I am running a training on a server. I have the following print out.
2018-11-05 21:08:07.907464: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:895] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-11-05 21:08:07.908090: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1105] Found device 0 with properties:
name: GeForce GTX 980 major: 5 minor: 2 memoryClockRate(GHz): 1.2405
pciBusID: 0000:02:00.0
totalMemory: 3.95GiB freeMemory: 3.87GiB
2018-11-05 21:08:07.908116: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1195] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 980, pci bus id: 0000:02:00.0, compute capability: 5.2)
As you can see the total memory is higher than the free memory. Actually, running the code i get an "Out of memory" message.
So i applied the wrote code at the beginning of my script:
gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction=0.3, allow_growth=True)
sess = tf.Session(config=tf.ConfigProto(gpu_options=gpu_options))
Unfortunately the memory usage:
totalMemory: 3.95GiB freeMemory: 3.87GiB
does not change at all. What is the problem?
Thanks and best regards,
Giovanni
The text was updated successfully, but these errors were encountered: