Testing TensorFlow with Python on Windows

Post Reply
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Testing TensorFlow with Python on Windows

Post by Antonio Linares »

Download and install Python: (check on Add Python on the path)

https://www.python.org/ftp/python/3.6.2 ... -amd64.exe

Run this from a terminal Window (cmd):

pip3 install --upgrade tensorflow

To test it:

c:\>python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant( "Hello world" )
>>> session = tf.Session()
>>> print( session.run( hello ) )
b'Hello world'
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Testing TensorFlow with Python on Windows

Post by Antonio Linares »

Running a python file:

hello.py

Code: Select all

print( "Hello world" )
 
Open a Windows console window (cmd) and type:
python hello.py
c:\>python hello.py
Hello world
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Testing TensorFlow with Python on Windows

Post by Antonio Linares »

Running tensorflow from a python file:

tf.py

Code: Select all

import tensorflow as tf
hello = tf.constant( "Hello world" )
session = tf.Session()
print( session.run( hello ) )
from a cmd window execute:
python tf.py
b'Hello world'
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply