macbook安裝cpu版tensorflow,pytorch,mxnet,keras

環境:

python2.7(anaconda環境)python

Mac OS X數據庫

CPU only(mac無n卡)網絡

 

強大的anaconda環境管理方便安裝各類包python2.7

 

安裝tensorflow(版本1.1.0)

sudo conda install -c https://conda.anaconda.org/conda-forge tensorflowspa

 驗證tensorflow是否安裝成功code

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

 

安裝pytorch(版本0.1.12)

一個是 torch, 一個 torchvision, torch 是主模塊, 用來搭建神經網絡的, torchvision 是輔模塊, 有數據庫, 還有一些已經訓練好的神經網絡等着你直接用, 好比 (VGG, AlexNet, ResNet).blog

sudo conda install -c soumith pytorch
it

sudo conda install torchvision -c soumithio

 

安裝mxnet(版本0.10.0)

sudo conda install -c https://conda.anaconda.org/derickl mxnet-cpuclass

 

安裝keras(版本2.0.2)

conda install -c https://conda.anaconda.org/conda-forge keras

因爲tensorflow版本過高,提示版本降級

The following packages will be DOWNGRADED:    tensorflow: 1.1.0-py27_0 conda-forge --> 1.0.0-py27_0 conda-forge

相關文章
相關標籤/搜索