Keras + Tensorflow: Prediction on multiple gpus

前端 未结 2 1067
谎友^
谎友^ 2020-12-17 16:39

I\'m using Keras with tensorflow as backend. I have one compiled/trained model.

My prediction loop is slow so I would like to find a way to parallelize the pre

2条回答
  •  失恋的感觉
    2020-12-17 17:07

    I created one simple example to show how to run keras model across multiple gpus. Basically, multiple processes are created and each of process owns a gpu. To specify the gpu id in process, setting env variable CUDA_VISIBLE_DEVICES is a very straightforward way (os.environ["CUDA_VISIBLE_DEVICES"]). Hope this git repo can help you.

    https://github.com/yuanyuanli85/Keras-Multiple-Process-Prediction

提交回复
热议问题