Can I run Keras model on gpu?

前端 未结 5 1436
不知归路
不知归路 2020-12-02 03:42

I\'m running a Keras model, with a submission deadline of 36 hours, if I train my model on the cpu it will take approx 50 hours, is there a way to run Keras on gpu?

5条回答
  •  一整个雨季
    2020-12-02 04:39

    Of course. if you are running on Tensorflow or CNTk backends, your code will run on your GPU devices defaultly.But if Theano backends, you can use following

    Theano flags:

    "THEANO_FLAGS=device=gpu,floatX=float32 python my_keras_script.py"

提交回复
热议问题