windows 10 + tensorflow-gpu 环境搭建

2021-06-21 19:03

阅读:585

标签:abs   source   bsp   cuda   安装完成   imp   without   完成   ssi   

参考:https://www.pugetsystems.com/labs/hpc/The-Best-Way-to-Install-TensorFlow-with-GPU-Support-on-Windows-10-Without-Installing-CUDA-1187/

 Install Anaconda Python

下载安装Anaconda, https://www.anaconda.com/download/

 安装完成后,在后面的步骤,在Anaconda Prompt中执行

Update Anaconda

conda update conda
conda update anaconda
conda update python
conda update --all

安装tensorflow-gpu

conda create --name tf-gpu   # Create a Python "virtual environment" for TensorFlow using conda
source activate tf-gpu       # 注意运行此命令后,命令行开头的提示变为(tf-gpu) user@computer:~$,表示tf-gpu环境处于激活状态
# 后面的命令,都在tf-gpu环境下执行,我保留了命令行的提示,以示区别
(tf-gpu) C:\Users\xxx> conda install tensorflow-gpu -y # install TensorFlow with GPU acceleration and all of the dependencies.

 测试安装的tensorflow-gpu

import tensorflow as tf
hello = tf.constant(Hello, TensorFlow!)
sess = tf.Session()
print(sess.run(hello))

不出意外,运行结果会打印

‘Hello, TensorFlow!‘

 

 

windows 10 + tensorflow-gpu 环境搭建

标签:abs   source   bsp   cuda   安装完成   imp   without   完成   ssi   

原文地址:https://www.cnblogs.com/xbit/p/10228747.html


评论


亲,登录后才可以留言!