环境:
python2.7(anaconda环境)
Mac OS X
CPU only(mac无n卡)
强大的anaconda环境管理方便安装各种包
安装tensorflow(版本1.1.0)
sudo conda install -c https://conda.anaconda.org/conda-forge tensorflow
验证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 >>>
安装pytorch(版本0.1.12)
一个是 torch, 一个 torchvision, torch 是主模块, 用来搭建神经网络的, torchvision 是辅模块, 有数据库, 还有一些已经训练好的神经网络等着你直接用, 比如 (VGG, AlexNet, ResNet).
sudo conda install -c soumith pytorch
sudo conda install torchvision -c soumith
安装mxnet(版本0.10.0)
sudo conda install -c https://conda.anaconda.org/derickl mxnet-cpu
安装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