当前位置:首页 » 《随便一记》 » 正文

anaconda+tensorflow安装完整步骤【亲测可用】

29 人参与  2023年05月05日 11:29  分类 : 《随便一记》  评论

点击全文阅读


anaconda+tensorflow安装完整步骤

anaconda安装tensorflow1.安装anaconda2.下载windows版本进行下载并安装3.打开Anaconda Prompt4. 安装tensorflow PyCharm下载与安装1.官网下载pycharm社区版2.PyCharm环境配置3.测试

anaconda安装tensorflow

1.安装anaconda

官网下载anaconda(https://www.anaconda.com/products/distribution)
在这里插入图片描述

2.下载windows版本进行下载并安装

在这里插入图片描述

3.打开Anaconda Prompt

在这里插入图片描述
(1)检测anaconda环境是否安装成功

conda --version

在这里插入图片描述
(2)检测目前安装了哪些环境变量:

conda info –-envs

在这里插入图片描述
(3) 在anaconda内安装一个配套的python并新建一个tensorflow的环境

conda create -n TF2 python==3.9

(TF2是自己命名的)
然后输入y
在这里插入图片描述

4. 安装tensorflow

(1)使用activate TF2(与你刚刚新建的环境名称相同)命令打开刚刚新建的tensorflow环境

activate TF2

若退出tensorflow的环境:

deactivate

(2)输入命令

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow

在这里插入图片描述
在这里插入图片描述
5.测试

pythonimport tensorflow as tftf.__version__

在这里插入图片描述

PyCharm下载与安装

1.官网下载pycharm社区版

pycharm windows版本下载地址:https://www.jetbrains.com/pycharm/download/#section=windows
在这里插入图片描述

2.PyCharm环境配置

在这里插入图片描述
在这里插入图片描述

3.测试

import tensorflow as tftensorflow_version = tf.__version__gpu_avilable = tf.test.is_gpu_available()print("tensorflow version: ", tensorflow_version,"\tGPU aviable:", gpu_avilable)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)

结果:
在这里插入图片描述
在这里插入图片描述
若在acanoda里没安装成功tensorflow,则在pycharm里进行安装。
点击File-settings
在这里插入图片描述
在这里插入图片描述


点击全文阅读


本文链接:http://zhangshiyu.com/post/60861.html

<< 上一篇 下一篇 >>

  • 评论(0)
  • 赞助本站

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

关于我们 | 我要投稿 | 免责申明

Copyright © 2020-2022 ZhangShiYu.com Rights Reserved.豫ICP备2022013469号-1