For Feedbacks | Enquiries | Questions | Comments - Contact us @ innovationmerge@gmail.com
What?
- This article explains how to setup TensorFlow and Keras deep learning frameworks with GPU for computation on windows 10 machine with NVIDIA GEFORCE 940MX GPU.
Why?
- Deep learning has taken Artificial Intelligence into the next level by building intelligent machines and systems.
- The mostly used frameworks in Deep learning is Tensorflow and Keras. Sometimes installation of these frameworks will take lot of Developers time.
- This article focuses on providing steps to install these and save Developer time.
How?
Software’s Required:
Network Requirements
- Internet to download packages
Implementation
Open Anaconda Navigator
Open Environments Tab
- Click on Create
Create new environment
- Enter environment name (Ex: neural_tf)
- Select Python and version as 3.7
- Click on create
Add conda-forge URL to Channels
Install Tensorflow GPU
- Select newly created Environment (neural_tf)
- Search for tensorflow-gpu
- Select listed packages
- Click on Apply
- Install packages by clicking Apply again
Install Keras
- Select newly created Environment (neural_tf)
- Search for keras
- Select listed packages
- Click on Apply
- Install packages by clicking Apply again
Install CUDA Tookit 10.0
Open link CUDA Toolkit Archive
Select CUDA Toolkit 10.1
Select
- Operating System -> Windows
- Architecture -> x86_64
- Version -> 10
- Installer Type -> exe
- Download the exe
- Run and Install
Download cuDNN 10.1
Login to Nvidia Developer website
Select cuDNN v8.0.5 for CUDA 10.1
Click on link cuDNN Library for Windows10
Set Environmental Variables
- Unzip downloaded zip file to any folder(C:\cudnn-10.1-windows10-x64-v8.0.5.39)
- Add its bin path to the Environmental Variables
- C:\cudnn-10.1-windows10-x64-v8.0.5.39\cuda\bin
- Add Nvidia Smi folder path to the Environmental Variables
- C:\Program Files\NVIDIA Corporation\NVSMI
Check Nvidia Driver installation
Open command prompt
Run command : nvidia-smi
You should be able to see the GPU information as below
Testing by invoking GPU from Tensorflow
Open command prompt
Activate environment by running below command
- conda activate neural_tf
Run below code
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tensorflow as tf gpus = tf.config.experimental.list_physical_devices('GPU') print(gpus) # Output: # [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')]
Great, iNNovationMerge hope that you have understood how to install and Run tensorflow on GPU