命名行方式(推荐)
Open Anaconda Powershell Prompt (or Anaconda Command Prompt), create a Python environment for TensorFlow, install the TensorFlow library, and activate the environment using the following method.
(打开Anaconda Powershell Prompt(或者Anaconda Command Prompt),然后为TensorFlow创建一个Python环境并安装tensorflow库和激活环境,使用以下方式。)
Install TensorFlow:
-
Download and install Anaconda or the smaller Miniconda.
-
On Windows open the Start menu and open an Anaconda Command Prompt. On macOS or Linux open a terminal window. Use the default bash shell on macOS or Linux.
-
Choose a name for your TensorFlow environment, such as “tf”.
-
To install the current release of CPU-only TensorFlow, recommended for beginners:
conda create -n tf tensorflow
conda activate tf
Or, to install the current release of GPU TensorFlow on Linux or Windows:
conda create -n tf-gpu tensorflow-gpu
conda activate tf-gpu
TensorFlow is now installed and ready to use.
参考:TensorFlow - Anaconda documentation
其他方式