人工智能实践:Tensorflow笔记00:anaconda,tensorflow,pycharm等一系列的安装与配置。
程序员文章站
2024-03-13 17:53:03
...
安装ananconda:
下载网站:
https://www.anaconda.com/distribution/
不*12h还是5%!
清华镜像:
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/?C=M&O=D
anaconda中安装tensorflow:
依次输入一系列的命令:选项全部y
conda create -n TF2.1 python=3.7
conda activate TF2.1
conda install cudatoolkit=10.1
conda install cudnn=7.6
pip install tensorflow==2.1
tensorflow过慢的话采取镜像方法:
pip install tensorflow==2.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
测试一下:
pycharm下载:
https://www.jetbrains.com/pycharm/download/#section=windows
记得下载社区版的。
配置测试代码:
import tensorflow as tf
tensorflow_version = tf.__version__
gpu_available = tf.test.is_gpu_available()
print("tensorflow version:", tensorflow_version, "\tGPU available:", gpu_available)
a = tf.constant([1.0, 2.0], name="a")
b = tf.constant([1.0, 2.0], name="b")
result = tf.add(a, b, name="add")
print(result)
参考:
https://www.icourse163.org/learn/PKU-1002536002#/learn/content?type=detail&id=1229556595
上一篇: python3.x安装