Where is the folder for Installing tensorflow with pip, Mac OSX?

前端 未结 2 1159
醉酒成梦
醉酒成梦 2021-01-31 07:57

just installed tensorflow using pip with the command:

$ pip install tensorflow

On the \"Getting Started\" for Tensorflow they have an example for co

2条回答
  •  梦谈多话
    2021-01-31 08:19

    It depends on where is the $TENSORFLOW environment variable is set. Let's help it setup.

    First check, $ echo $TENSORFLOW if it returns blank, you need to setup the access of tensorflow in any directory from your console.

    There are two cases of that:

    1. In case you have python from anaconda library/environment (let say you have anaconda2), the usually installed location is: ~/anaconda2/lib/python2.7/site-package/tensorflow

    2. In case of Python2.x or Python3.x, x = is subversion like 2.7 or 3.5, the usually installed location is: /usr/local/lib/python2.x/site-packages/tensorflow

    Now that you have identified the python version, use it as the onetime path in bash or profile. Type this Linux code:

    $ vi ~/.bashrc

    add this line at the bottom of the bashrc file.

    $ export $TENSORFLOW="~/anaconda2/lib/python2.7/site-packages/tensorflow:$PATH"

    check again in a new terminal

    $ echo $TENSORFLOW to verify.

    or use `source ~/.bashrc' to reload the new environment variables.

    Now you can all set to use

    $ python tensorflow/models/image/mnist/convolutional.py

    directly by

    $ python -m tensorflow.models.image.mnist.convolutional.py

    Now your program as per description in TensorFlow tutorial will search these path with period (.) instead of "/" with the -m argument.

提交回复
热议问题