Importing the right libraries is where we start. Apart from tensorflow, we will be using numpy and math for computations, scipy, matplolib for images and graphics, and warnings, random, and distutils for support in specific operations:
import numpy as np
import tensorflow as tf
import math
import warnings
import matplotlib.pyplot as plt
from scipy.misc import imresize
from random import shuffle
from distutils.version import LooseVersion