mac使用pip3安装tensorflow(不用conda)

在终端中输入pip3 install tensorflow回提示一个当先版本匹配不到的错误提示

在终端中输入:

pip3 --default-timeout=10000 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.3.0-py3-none-any.whl

测试代码:

import tensorflow as tf

str = tf.constant('hello')

print(str)

sess = tf.Session()

rs = sess.run(str)

print(rs)

#b'hello'

type(rs)

#<class 'byte'>

posted on 2019-11-15 13:19  __keras  阅读(578)  评论(0)    收藏  举报

导航