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'>

猜你喜欢

转载自www.cnblogs.com/mituzhifan-/p/11865745.html