降低python至3.5
conda install python=3.5
创建一个tensorflow 虚拟环境:
conda create -n tensorflow python=3.5
激活tensorflow虚拟环境
activate tensorflow
安装tensorflow
pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple (从国内镜像源下载,速度极快且稳定)
然后测试
python
import tensorflow as tf
message=tf.constant(‘welcome’)
with tf.Sesiion() as sess:
print(sess.run(message).decode())
运行成功,但是jupyter notebook打开后输入
import tensorflow as tf
运行报错,需要在激活TensorFlow之后安装ipython和jupyter
(tensorflow)D:>conda install ipython
···
(tensorflow)D:>conda install jupyter
···
接着安装nb_conda包库
(tensorflow)D:>conda install nb_conda
然后启动jupyter notebook
结果显示
就成功了
原文地址:https://blog.csdn.net/m0_37723350/article/details/90238732
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。