Described the settings up to handling TensorFlow with Intelij IDEA.
It is assumed that Python 2.7 is included. Install pip virtualenv
$ sudo easy_install pip
$ sudo pip install --upgrade virtualenv
Create an environment with virtualenv
$ virtualenv --system-site-packages ~/tensorflow
$ cd ~/tensorflow
activate
$ source bin/activate # If using bash
$ source bin/activate.csh # If using csh
When activated, the notation changes to the following
(tensorflow)$
This time I will install only with MAC CPU version
(tensorflow)$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
Launch python
$ python
If you can execute the following code, tensorflow is running in a hurry.
import tensorflow as tf
hello = tf.constant('HelloWorld')
sess = tf.Session()
print sess.run(hello)
Intellij IDEA settings from here
Select File> New Project> Python Module
Press the "+" button on the Configure SDK screen
Select "Python SDK"
From "select interpreter path", select ~ / tensorflow ... created above.
It will be added as an SDK, so OK and proceed to finish
Create a python file and import tensorflow ~ Write the code for
Select the file you just created from Run> Run
OK if Hello World appears on the console
that's all
Recommended Posts