How do I use TensorFlow GPU?

前端 未结 7 1891
予麋鹿
予麋鹿 2020-11-28 06:00

How do I use TensorFlow GPU version instead of CPU version in Python 3.6 x64?

import tensorflow as tf

Pytho

7条回答
  •  孤独总比滥情好
    2020-11-28 06:53

    The 'new' way to install tensorflow GPU if you have Nvidia, is with Anaconda. Works on Windows too. With 1 line.

    conda create --name tf_gpu tensorflow-gpu 
    

    This is a shortcut for 3 commands, which you can execute separately if you want or if you already have a conda environment and do not need to create one.

    1. Create an anaconda environment conda create --name tf_gpu

    2. Activate the environment activate tf_gpu

    3. Install tensorflow-GPU conda install tensorflow-gpu

    You can use the conda environment.

提交回复
热议问题