A day with .Net

My day to day experince in .net

Posts Tagged ‘python tools visual studio’

Installing Tensorflow in Windows and Visual Studio – Deep learning.

Posted by vivekcek on March 25, 2017

Recently i was working with designing a chat-bot with Microsoft bot framework.
And i was using a combination of Retrieval based model and Intent/Entity based model.

During the research i decided to include some deep learning into the bot with a Generative Model.
Because generative Models will be the future of chat bot’s.

So i decided to play with Google’s tensorflow for deep learning implementation.
As i am a .NET guy, i like to do all my experiments with Visual Studio.
Then i googled and found that we can integrate tensorflow with Visual Studio.

So how can we do that? First we need to have below software requirements.

1. A 64 bit Windows.
2. Visual studio 2015.

Now download 64 bit Python 3.5, You can have it from below link.
https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe

Install python, Please ensure that you selected the “Add Python 3.5 to PATH”

Now open the Command Prompt in Administrator Mode.
Then check the Python Version, by using below commands and ensure that you have 3.5 , 64 bit version.

python --version

Now we need to update pip, Issue the below command.

python -m pip install --upgrade pip

Now install the CPU mode tensorflow by using below command.

pip install tensorflow

Now try this code in your python prompt.

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))

Now to do python in visual studio, we need to install Python Tools For Visual Studio.
Have it from this link https://github.com/Microsoft/PTVS

After successful installation create a python application in Visual studio.

Add below code in your file and run.

import tensorflow as tf
hello = tf.constant('Hello, Tensorflow on Windows!')
sess = tf.Session()
print(sess.run(hello))

Posted in Tensorflow | Tagged: , , , | Leave a Comment »