MAC mounting tensorflow + keras

To upload it tensorflow recent run experiments, we tried two methods mac, here to record it.

Method One: according to the instructions of the official website, the installation fails ...
mainly with reference to the official website of the steps, see the installation steps , I was carrying tensorflow steps to download the code there is a problem:

git clone https://github.com/tensorflow/tensorflow.git

Multiple downloads have emerged error:

error: RPC failed; curl 18 transfer closed with outstanding read data remain

Check the next question is about memory or network, try a variety of solutions afternoon failed to give up ...

Method two: a reference TensorFlowNews method described blog, I have chosen a method used virtualenv installation, the following steps:
1. Open the terminal mounted with pip virtualenv

sudo pip install --upgrade virtualenv

2. Create a virtual environment

virtualenv --system-site-packages targetDirectory # for Python 2.7
virtualenv --system-site-packages -p python3 targetDirectory # for Python 3.n

NOTE: targetDirectory replaced with the installation path tensorflow
3. Activate environment tensorflow

source tensorflow/bin/activate      # If using bash, sh, ksh, or zsh
source tensorflow/bin/activate.csh  # If using csh or tcsh 

4. Installation tensorflow its dependencies

pip install --upgrade tensorflow      # for Python 2.7
pip3 install --upgrade tensorflow     # for Python 3.n
pip install keras -U --pre	#for keras

5. Verify installation
execute command python

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

Print successfully install successfully
6. Exit tensorflow environment

deactivate 

7. uninstall tensorflow, you can remove the directory

rm -r /tensorflow 
Published 18 original articles · won praise 3 · views 20000 +

Guess you like

Origin blog.csdn.net/hyluglare/article/details/95023902