安装TensorFlow
Python版本3.8
在Win10的Windows PowerShell中,执行命令
python -m pip install tensorflow (下载速度太慢,所以使用下面命令)
python -m pip install -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com tensorflow

Hello world程序
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
hello=tf.constant('Hello,TensorFlow')
config=tf.compat.v1.ConfigProto()
sess=tf.compat.v1.Session()
print(sess.run(hello))

本文详细介绍在Windows 10环境下使用Python 3.8安装TensorFlow的过程,并提供加速下载的阿里云镜像命令。此外,还展示了如何运行一个简单的HelloWorld程序,包括禁用急切执行、创建会话并打印输出。
299

被折叠的 条评论
为什么被折叠?



