2018年2月11日 星期日

[TensorFlow] Install on Windows


 TensorFlow  



Introduction


(From WIKI)
TensorFlow is an open-source software library for dataflow programming across a range of tasks. It is a symbolic math library, and also used for machine learning applications such as neural networks.





Environment

Python 3.6.2
TensorFlow 1.5.0


Install


Python

Make sure that Pyython 3.5 or 3.6 64-bit is installed in ur environment.



TensorFlow

Before install TensorFlow, consider that creating a virtual environment by Virtualenv or venv.

$ pip3 install --upgrade tensorflow

PS. You can install TensorFlow with GPU support, see more on official document.

If you encounters the following issue:
Could not find a version that satisfies the requirement tensorflow (from versions: )

That means you don’t have the right Python installed, often happens when 32-bit version was installed but not 64-bit.


Check if you installed it successfully or not.

$ pip3 show tensorflow

$ pip3 show tensorflow
Name: tensorflow
Version: 1.5.0
Summary: TensorFlow helps the tensors flow
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: c:\users\ppipp\downloads\github\python.practice\src\tensorflow\venv\lab\lib\site-packages
Requires: absl-py, numpy, six, wheel, tensorflow-tensorboard, protobuf




Create a “Hello, TensorFlow”

Hello.py

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello).decode("utf-8"))



$ python Hello.py

>> Hello, TensorFlow!



Reference








沒有留言:

張貼留言