pycharm适配python 3.9的tensorflow安装
tensorflow
一个面向所有人的开源机器学习框架
项目地址:https://gitcode.com/gh_mirrors/te/tensorflow

·
一、引言
tensorflow是常用的图像处理模型框架,结合机器学习可作用于计算机视觉。
运行环境:python 3.9,pycharm 2021.1
安装版本:tensorflow 2.6.0,tensorflow-gpu 2.6.0
二、安装
1)python 3.9版本只能适配tensorflow 2.5以上版本,在已安装好python环境下,在cmd中输入pip install tensorflow 命令可以直接安装最新适配版本,输入pip install tensorflow-gpu命令可以直接安装gpu最新版本,但需要电脑gpu达到一定配置需求才可使用。
2)在pycharm中写入import tensorflow as tf代码,若tensorflow还标红,直接在pycharm中点击install,编译器会直接进行安装。
三、测试
1)在cmd中输入命令pip show tensorflow或者pip show tensorflow-gpu可以查看当前tensorflow版本。
2)在pycharm中输入以下代码,注意在tensorflow 2版本以上的版本中,与1版本有一些语法上的区分。
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
hello = tf.constant('hello,tensorflow')
sess= tf.compat.v1.Session()
print(sess.run(hello))
输出:
b’hello,tensorflow’
即为安装成功。




一个面向所有人的开源机器学习框架
最近提交(Master分支:20 天前 )
4f64a3d5
Instead, check for this case in `ResolveUsers` and `ResolveOperand`, by querying whether the `fused_expression_root` is part of the `HloFusionAdaptor`.
This prevents us from stepping into nested fusions.
PiperOrigin-RevId: 724311958
20 天前
aa7e952e
Fix a bug in handling negative strides, and add a test case that exposes it.
We can have negative strides that are not just -1, e.g. with a combining
reshape.
PiperOrigin-RevId: 724293790
20 天前
更多推荐
所有评论(0)