• Home
  • Install Tensorflow on Windows 10 Working

Install Tensorflow on Windows 10 Working

Tensorflow is the frame work that use in Machine Learning and Deep Learning .Today im going to show you how to install Tensorflow -CPU version on your computer.

Here i’m not using GPU version because if your machine have a gpu if you are installing additional driver packages like CUDA it will give some errors so I’m going to install Tensorflow with CPU on my computer.

first google mini conda and download the python 3.x version.in my machine i used python 3.7. i prefer miniconda because that contain tools we needed.

https://docs.conda.io/en/latest/miniconda.html

i used this link to get python 3.7 version of miniconda https://repo.anaconda.com/miniconda/ search something like Miniconda3-py37_4.8.3-Windows-x86_64.exe py37 means python 3.7 after download install the application as normal software. This will install python 3.7 in your computer.

Now first thing first install jupyter notebook on your computer so command is

conda install jupyter -y

Best wayto install Tensorflow is using virtual enviroment because you can isolate the virtual enviroment and it won’t unstable your computer. first create anaconda virtual enviroment called mytensorflow

conda create --name mytensorflow python=3.7

this mytensorflow virtual environment is python 3.7 inside this virtual environment we are going to install all the machine learning and deep learning libraries.

first we have to activate our virtual environment. After activate the virtual environment we can install packages

conda activate mytensorflow

now install jupyter notebook environment to the our environment

conda install nb_conda

now install the Tensorflow using following command .This will install Tensorflow CPU version.

conda install -c anaconda tensorflow

Install Additional required libraries with this command copy this code and create tools.yml file

 dependencies:
    - jupyter
    - scikit-learn
    - scipy
    - pandas
    - pandas-datareader
    - matplotlib
    - pillow
    - tqdm
    - requests
    - h5py
    - pyyaml
    - flask
    - boto3
    - pip:
        - bayesian-optimization
        - gym
        - kaggle

conda env update --file tools.yml

I hope still your conda virtual enviroment is active if not pleace activate conda envirioment using the

conda activate mytensorflow

Then we are going to register our environment to work with Jupyter Notebook. This will allow to work with your virtual environment.Other wise you cannot see the tensorflow package.

python -m ipykernel install --user --name mytensorflow --display-name "Python 3.7 (My_tensorflow)"

Now Open Command prompt using windows +r and type cmd in run box

now navigate to anyplace you prefer .My choice is Desktop and create new folder in my case im create MLLesson

Now im cd to MLLesson ,So now i’m inside the MLLesson folder now i’m open Jupyter notebook there. This folder work as jupyter notebook root folder for notebook files. So it is easy to find notebook files in one place.

Make sure to activate your virtual environment if it is not activated.

conda activate mytensorflow

after activating virtual enviroment run jupyter notebook using folowing command

jupyter notebook

this will start jupyter notbook server in localhost and running you can see the url and port that running on your machine. Now you can interactive jupyter notebook and work with the Tensorflow.

create notebook make sure to go to new and selected registerd enviroment in earlier step .Select the enviroment “Python 3.7 (My_tensorflow)”

check Tensorflow version using this command

import sys
import tensorflow as tf
print(tf.version)

I hope this tutorial will help you,If you like this my content please like share with your friends.

Have a good Day See you in next tutorial.

Leave A Comment