Introduction
Visual Studio Code is a popular open-source IDE distributed by Microsoft. This is a powerful tool which support wide variety of code development almost across all the platforms. This allows various extensions which can be installed to support entire end-to-end development life-cycle.
Google’s TensorFlow is well known Deep Learning library which was originally available for the Python developers.
This article describe about preparing TensorFlow development environment on Visual Studio Code on Windows VM.
Prerequisites
- Download and install Visual Studio Code
- Python: TensorFlow support version 3.4, 3.5, 3.6 (64-bit version)
- Pip: Which installs as an option with Python
- VirtualEnv: To setup virtual environment for TF
- Download and install Visual C++ 2015 Redistributable Update 3 from this URL: https://www.microsoft.com/en-us/download/details.aspx?id=53587
Setup Steps
- Download and install Visual Studio Code on the Windows 64-bit machine. The the download url and installation instructions are available on VS Code site
- Open VS Code and create a workspace folder. Also create a dummy python file, call it tf_test.py.
- Once the file is created – VS Code will prompt for Python installation and Python extensions for VS Code. Install Python 3.6 from official download site. [Ignore if Python is already installed].
- Allow VSCode to install and enable necessary extensions for Python, e.g. Pylint, etc..
- TensorFlow installation: refer the [url]
- Install Virtual env
PS C:\Program Files\Python36> pip3 install -U pip virtualenv - Create new TensorFlow virtual environment:
virtualenv --system-site-packages -p python ./tensorflow - Activate the TenforFlow virtualenv:
PS C:\Program Files\Python36> ./tensorflow/scripts/activate
(tensorflow) PS C:\Program Files\Python36> - Execute the python script as:
(tensorflow) PS C:\Program Files\Python36> python <filePpath>\tf_test.py.
Lastly, to deactivate and exit the virtual environment use : deactivate
Conclusion
This simple tutorial for TensorFlow setup on the Windows machine will help developers who are not comfortable to start with training Deep Learning models on Ubuntu (or any Linux) machine.
No comments:
Post a Comment