Testing TensorFlow with Python on Windows

Testing TensorFlow with Python on Windows

Postby Antonio Linares » Wed Aug 02, 2017 7:41 am

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

https://www.python.org/ftp/python/3.6.2/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: 35252
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Testing TensorFlow with Python on Windows

Postby Antonio Linares » Wed Aug 02, 2017 9:32 am

Running a python file:

hello.py
Code: Select all  Expand view
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: 35252
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Testing TensorFlow with Python on Windows

Postby Antonio Linares » Wed Aug 02, 2017 9:35 am

Running tensorflow from a python file:

tf.py
Code: Select all  Expand view
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
User avatar
Antonio Linares
Site Admin
 
Posts: 35252
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to Off Topic / Otros temas

Who is online

Users browsing this forum: No registered users and 2 guests