关于tensorflow:window10tensorflow安装

3次阅读

共计 748 个字符,预计需要花费 2 分钟才能阅读完成。

1、首先 windows10 下我这边环境是 CPU 环境,先得装置 anaconda
我用国内镜像源进行装置

https://mirrors.bfsu.edu.cn/a…

装置后关上 anaconda prompt 进行镜像源的配置,此处也能够不进行国内源配置,依据电脑状况:

conda config –add channels https://mirrors.tuna.tsinghua…

conda config –set show_channel_urls yes

conda create -n tensorflow python=3.7.1 – 依据本人 Python 版本也就是 TensorFlow 的环境筹备

activate tensorflow – 激活 tensorflow

2、之后装置最新的 tensorflow
pip3 install -i https://mirrors.aliyun.com/py… –upgrade tensorflow –default-timeout=600

也就是 –upgrade tensorflow 是获取最新的镜像版本,之后 –default-timeout=600 是怕下载时超时,此处 tensorflow 尽量装置最新版本的,要不然应用的时候会提醒异样

3、装置实现后,则能够在 pycharm 外面进行验证应用
2.0 版本此处 tensorflow 应用 session 须要降版本,采坑:
import tensorflow as tf

tf.compat.v1.disable_eager_execution()

hello = tf.constant(‘hello,tf’)

sess = tf.compat.v1.Session()

print(sess.run(hello))


当打出 hello 时,证实运行胜利!

心愿对大家有帮忙!

正文完
 0