mac上安装Tensorflow, python 3 遇到AttributeError: module ‘tensorflow’ has no attribute ‘constant’, 查找了很多资料发现还是不对,最后找到
https://qiita.com/tom_ato/items/bbdf4574b3ecb0048fa1
解决了问题,如果你之前已经安装过tensorflow, python3, 先不需要按照上面的steps来操作,可以直接执行如下命令:
$ sudo easy_install pip
$ sudo easy_install --upgrade six
$ sudo pip install --upgrade pip
$ pip3 install --upgrade tensorflow
看能不能解决你的问题,如果不能解决,你再按照上面链接中的steps来操作,
最后通过如下代码验证:
$ python
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(ses