Introduction
This repository contains various tutorials written for DataCamp.
How to run code?
I like to keep the Python setup in my OS very simple and create virtual environments with required custom libraries depending on the project I want to run. I would very much like to use Docker for this purpose, as that is the de-facto standard for process isolation. However since I am using Windows there is no way for me to expose my GPU to Docker. Thus, I opt to conda
and Python virtual environment.
Using conda environment
- Download and install Anaconda
- Make sure conda is in the system PATH by trying
conda --version
on a terminal - Create a conda virtual environment using
conda create -n datacamp.tutorials python=3.5
cd
into the project directory- Install tensorflow as follows
- If you do not have a GPU use:
conda install -n datacamp.tutorial --yes --file requirements.txt
- If you do have a GPU use:
conda install -n datacamp.tutorials --yes --file requirements_gpu.txt
- If you do not have a GPU use:
- Activate the newly created environment with
activate datacamp.tutorials
Further reading on how to setup conda environments: Here
Using Python virtualenv
I prefer conda because numpy, pandas and tensorflow CPU operations are much faster than when used with pip according to this article. But if you prefer to use Python virtualenv, use the following steps.
- Download and install Python 3.5
- Now install
virtualenv
withpip3 install virtualenv
cd
into the project directory- Create a virtual environment with
virtualenv -p <path to python 3.5> datacamp.tutorials
- Activate the virtual environment as follows
- If you are on Windows:
<project_dir>\datacamp.tutorials\Scripts\activate
- If you are on Ubuntu:
source <project_dir>\datacamp.tutorials\bin\activate
- If you are on Windows:
- Install tensorflow as follows
- If you do not have a GPU use:
pip3 install -r requirements.txt
- If you do have a GPU use:
pip3 install -r requirements_gpu.txt
- If you do not have a GPU use: