frankkramer-lab / MIScnn

A framework for Medical Image Segmentation with Convolutional Neural Networks and Deep Learning
GNU General Public License v3.0
402 stars 116 forks source link

Set up tensorflow and GPUs #32

Closed deeplearining-sheen closed 4 years ago

deeplearining-sheen commented 4 years ago

Hi,

I played updated KiTS19. Obviously, I installed tensorflow-gpu.

In order to check GPU, I played the bleow, but GPU was nothing. print("Num GPUs Available: ", len(tf.config.experimental.list_physicaldevices('GPU'))) **And then I got : Num GPUs Available: 0_**

I played the following code.... I got error message

Please let me know how to correct it for GPU.

Heesoon.

physical_devices = tf.config.list_physical_devices('GPU') tf.config.experimental.set_memory_growth(physical_devices[0], True)

**IndexError Traceback (most recent call last)

in () 4 import tensorflow as tf 5 physical_devices = tf.config.list_physical_devices('GPU') ----> 6 tf.config.experimental.set_memory_growth(physical_devices[0], True) IndexError: list index out of range** ![GPU_ISSUE](https://user-images.githubusercontent.com/67444210/90252982-641a2480-de7b-11ea-8c96-e0124b0aadff.PNG)
muellerdo commented 4 years ago

Hey @deeplearining-sheen,

if I understand you correctly, your GPU is not visible in the script?

With how many GPUs are you working? If you have a single GPU, try out changing the environment line from 1 to 0 to specify which devices are visible.

os.environ["CUDA_VISIBLE_DEVICES"] = "0"

If this approach isn't working, I would recommend checking out the Tensorflow documentation to verify a working GPU support on your system: https://www.tensorflow.org/install/gpu

Another option would be to utilize the Tensorflow Docker image which is plug-&-play solution with all required CUDA libraries etc: https://www.tensorflow.org/install/docker

Cheers, Dominik Müller

deeplearining-sheen commented 4 years ago

Many Thanks!

I solved it.

Heesoon.