Google Colaboratory - 멀티 GPU 미지원 문제, ValueError: To call `multi_gpu_model` with `gpus=8`, we expect the following devices to be available, ValueError: For multi-gpu usage to be effective, call `multi_gpu_model` with `gpus >= 2`. Received: ..

CODEDRAGON Development/Python

반응형



 

 

Google Colaboratory - 멀티 GPU 미지원 문제

Colaboratory에서는 아직 멀티 GPU 지원하지 않습니다

그래서 케라스의 multi_gpu_model() 사용할 경우 ERROR 발생합니다.

 

 

현재 머신에는 CPU 하나와 GPU 하나를 가지고 있어 실행할 없다고 나옵니다. (/cpu:0', '/gpu:0')

parallel_model = multi_gpu_model(model, gpus=8)

ValueError: To call `multi_gpu_model` with `gpus=8`, we expect the following devices to be available: ['/cpu:0', '/gpu:0', '/gpu:1', '/gpu:2', '/gpu:3', '/gpu:4', '/gpu:5', '/gpu:6', '/gpu:7']. However this machine only has: ['/cpu:0', '/gpu:0']. Try reducing `gpus`.

 

 

 

 

 

multi_gpu_model()에서 gpu하나로 실행하려고 하면 개는 의미가 없으므로 2 이상 사용하라는 에러가 발생합니다. (with `gpus >= 2`)

parallel_model = multi_gpu_model(model, gpus=1)

ValueError: For multi-gpu usage to be effective, call `multi_gpu_model` with `gpus >= 2`. Received: `gpus=1`

 

 

 

 

GPU 수행 방법

gpu하나로 수행할 경우 cpu 대신 gpu 설정하여 코드를 실행할 있습니다.

start = datetime.datetime.now()

with tf.device('/cpu:0'):

start = datetime.datetime.now()

with tf.device('/gpu:0'):

 

 


반응형