Mac 上搭建TensorFlow环境
程序员文章站
2022-07-07 21:29:50
...
- 安装HomeBrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
实际地址以Homebrew主页显示为主 - 安装Python
brew install python
- 安装pip
sudo easy_install pip
sudo easy_install --upgrade six
- 安装tensorflow
$pip install tensorflow
$pip install tensorflow-gpu #GPU support version#
- 测试tensorflow
$ python
...
>>> import tensorflow as tf
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
Hello, TensorFlow!
>>> a = tf.constant(10)
>>> b = tf.constant(32)
>>> print(sess.run(a + b))
42
上一篇: #笔记(二十一)#安全
下一篇: ionic 在mac上的环境搭建