├── .gitignore ├── mean.pkl ├── pictures ├── loss.png ├── top1-acc.png └── top5-acc.png ├── summary ├── train │ ├── events.out.tfevents.1534877421.ps5p6tl43 │ ├── events.out.tfevents.1534960360.ps5p6tl43 │ └── events.out.tfevents.1535044762.ps5p6tl43 └── val │ ├── events.out.tfevents.1534877421.ps5p6tl43 │ ├── events.out.tfevents.1534960360.ps5p6tl43 │ └── events.out.tfevents.1535044762.ps5p6tl43 ├── logs.py ├── hparam.json ├── data_augment.py ├── utils.py ├── data.py ├── README.rst ├── model.py ├── LICENSE └── screenlog_test.0 /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | logs.log 3 | *~ 4 | *.pyc -------------------------------------------------------------------------------- /mean.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paniabhisek/AlexNet/HEAD/mean.pkl -------------------------------------------------------------------------------- /pictures/loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paniabhisek/AlexNet/HEAD/pictures/loss.png -------------------------------------------------------------------------------- /pictures/top1-acc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paniabhisek/AlexNet/HEAD/pictures/top1-acc.png -------------------------------------------------------------------------------- /pictures/top5-acc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paniabhisek/AlexNet/HEAD/pictures/top5-acc.png -------------------------------------------------------------------------------- /summary/train/events.out.tfevents.1534877421.ps5p6tl43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paniabhisek/AlexNet/HEAD/summary/train/events.out.tfevents.1534877421.ps5p6tl43 -------------------------------------------------------------------------------- /summary/train/events.out.tfevents.1534960360.ps5p6tl43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paniabhisek/AlexNet/HEAD/summary/train/events.out.tfevents.1534960360.ps5p6tl43 -------------------------------------------------------------------------------- /summary/train/events.out.tfevents.1535044762.ps5p6tl43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paniabhisek/AlexNet/HEAD/summary/train/events.out.tfevents.1535044762.ps5p6tl43 -------------------------------------------------------------------------------- /summary/val/events.out.tfevents.1534877421.ps5p6tl43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paniabhisek/AlexNet/HEAD/summary/val/events.out.tfevents.1534877421.ps5p6tl43 -------------------------------------------------------------------------------- /summary/val/events.out.tfevents.1534960360.ps5p6tl43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paniabhisek/AlexNet/HEAD/summary/val/events.out.tfevents.1534960360.ps5p6tl43 -------------------------------------------------------------------------------- /summary/val/events.out.tfevents.1535044762.ps5p6tl43: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paniabhisek/AlexNet/HEAD/summary/val/events.out.tfevents.1535044762.ps5p6tl43 -------------------------------------------------------------------------------- /logs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | 4 | import logging 5 | import sys 6 | 7 | def get_logger(logger_name='AlexNet', file_name='logs.log'): 8 | logger = logging.getLogger(logger_name) 9 | logger.setLevel(logging.DEBUG) 10 | 11 | fh = logging.FileHandler(file_name) 12 | fh.setLevel(logging.DEBUG) 13 | 14 | ch = logging.StreamHandler(sys.stdout) 15 | ch.setLevel(logging.INFO) 16 | 17 | formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') 18 | fh.setFormatter(formatter) 19 | ch.setFormatter(formatter) 20 | 21 | logger.addHandler(fh) 22 | logger.addHandler(ch) 23 | 24 | return logger 25 | -------------------------------------------------------------------------------- /hparam.json: -------------------------------------------------------------------------------- 1 | { 2 | "L1": 3 | { 4 | "filters": 96, 5 | "stride": 4, 6 | "padding": "VALID", 7 | "filter_size": [11, 11, 3] 8 | }, 9 | "L1_MP": 10 | { 11 | "stride": 2, 12 | "filter_size": [3, 3] 13 | }, 14 | "L2": 15 | { 16 | "filters": 256, 17 | "stride": 1, 18 | "padding": "SAME", 19 | "filter_size": [5, 5, 96] 20 | }, 21 | "L2_MP": 22 | { 23 | "stride": 2, 24 | "filter_size": [3, 3] 25 | }, 26 | "L3": 27 | { 28 | "filters": 384, 29 | "stride": 1, 30 | "padding": "SAME", 31 | "filter_size": [3, 3, 256] 32 | }, 33 | "L4": 34 | { 35 | "filters": 384, 36 | "stride": 1, 37 | "padding": "SAME", 38 | "filter_size": [3, 3, 384] 39 | }, 40 | "L5": 41 | { 42 | "filters": 256, 43 | "stride": 1, 44 | "padding": "SAME", 45 | "filter_size": [3, 3, 384] 46 | }, 47 | "L5_MP": 48 | { 49 | "stride": 2, 50 | "filter_size": [3, 3] 51 | }, 52 | "FC6": 4096, 53 | "FC7": 4096 54 | } 55 | -------------------------------------------------------------------------------- /data_augment.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | 4 | # library modules 5 | from random import randint 6 | import logging 7 | 8 | # External library modules 9 | from PIL import Image 10 | from PIL import ImageOps 11 | 12 | # local modules 13 | from utils import imgs2np 14 | 15 | logger = logging.getLogger('AlexNet.data_augment') 16 | 17 | def mirror(image): 18 | """ 19 | Return the horizontal mirror of the given image 20 | 21 | :type image: Pillow Image object 22 | """ 23 | return image.transpose(Image.FLIP_LEFT_RIGHT) 24 | 25 | def rotate(image): 26 | """ 27 | Rotate the given image to 90 and 270 degrees 28 | to produce to different images. 29 | 30 | :type image: Pillow Image object 31 | """ 32 | # 90 degree 33 | img1 = image.rotate(90) 34 | 35 | # 270 degree 36 | img2 = image.rotate(270) 37 | 38 | return [img1, img2] 39 | 40 | def mirror_and_rotate(image): 41 | """ 42 | Mirror the image and then rotate(90 and 270 43 | degrees separately). 44 | 45 | :type image: Pillow Image object 46 | """ 47 | return rotate(mirror(image)) 48 | 49 | def invert(image): 50 | """ 51 | Invert the pixel intensities to produce 52 | different looking image. 53 | 54 | :type image: Pillow Image object 55 | """ 56 | return ImageOps.invert(image) 57 | 58 | def random_crop(image, times): 59 | """ 60 | Randomly crop the given image for `:py:times:` many times. 61 | 62 | :type image: Pillow Image object 63 | :param times: How many times to crop the image 64 | """ 65 | # random candidate 66 | random_cand = [image.size[0] - 227, 67 | image.size[1] - 227] 68 | 69 | if random_cand[0] < 0: 70 | random_cand[0] = 0 71 | logger.warning("Image size: %d x %d", image.size[0], 72 | image.size[1]) 73 | if random_cand[1] < 0: 74 | random_cand[1] = 0 75 | logger.warning("Image size: %d x %d", image.size[0], 76 | image.size[1]) 77 | 78 | final_images = [] 79 | for i in range(times): 80 | area = [None] * 4 81 | area[0] = randint(0, random_cand[0]) 82 | area[1] = randint(0, random_cand[1]) 83 | area[2] = area[0] + 227 84 | area[3] = area[1] + 227 85 | final_images.append(image.crop(area)) 86 | 87 | return final_images 88 | 89 | @imgs2np 90 | def augment(image, size, times=10): 91 | """ 92 | Augment data using different type of methods like 93 | - Mirroring 94 | - Rotation 95 | - Invertion 96 | - Cropping 97 | """ 98 | augmented_imgs = [image.resize(size)] 99 | augmented_imgs.append(mirror(augmented_imgs[0])) 100 | augmented_imgs.extend(rotate(augmented_imgs[0])) 101 | augmented_imgs.extend(mirror_and_rotate(augmented_imgs[0])) 102 | augmented_imgs.append(invert(augmented_imgs[0])) 103 | 104 | random_crps = random_crop(image, times) 105 | 106 | for img_crp in random_crps: 107 | augmented_imgs.append(img_crp) 108 | #augmented_imgs = [img_crp] 109 | augmented_imgs.append(mirror(img_crp)) 110 | augmented_imgs.extend(rotate(img_crp)) 111 | augmented_imgs.extend(mirror_and_rotate(img_crp)) 112 | augmented_imgs.append(invert(img_crp)) 113 | 114 | return augmented_imgs 115 | -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | #/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # library modules 5 | import os 6 | import pickle 7 | import logging 8 | import time 9 | 10 | from random import randint 11 | from random import choice 12 | from queue import Queue 13 | from math import ceil 14 | from threading import Thread 15 | from threading import Lock 16 | from logs import get_logger 17 | 18 | # external library modules 19 | from PIL import Image 20 | import numpy as np 21 | 22 | def img2PIL(image): 23 | """ 24 | Converts an image to a pillow object. 25 | If it is greyscale image, then convert it to RGB first 26 | 27 | :param image: path to the image file 28 | """ 29 | img = Image.open(image) 30 | 31 | if img.mode != 'RGB': 32 | img = img.convert('RGB') 33 | img.load() 34 | 35 | return img 36 | 37 | def img2np(image, size=None): 38 | """ 39 | Converts an image to numpy data. 40 | If it is greyscale image, then convert it to RGB first 41 | and then change to numpy array 42 | 43 | :param image: path to the image file 44 | :param size: If given reshape the image to this size. 45 | """ 46 | img = Image.open(image) 47 | 48 | if img.mode != 'RGB': 49 | img = img.convert('RGB') 50 | if size: 51 | img = img.resize(size) 52 | img.load() 53 | 54 | return np.asarray(img, dtype = "int32") 55 | 56 | def imgs2np(function): 57 | """ 58 | Convert list of pillow images to its numpy equivalent. 59 | """ 60 | 61 | def wrapper(*args, **kwargs): 62 | images = function(*args, **kwargs) 63 | 64 | for i, image in enumerate(images): 65 | images[i] = np.asarray(image, dtype=np.int32) 66 | 67 | return images 68 | 69 | return wrapper 70 | 71 | def gen_mean_activity(base_dir): 72 | """ 73 | Generate mean activity for each channel over entire training set 74 | 75 | :param base_dir: Base directory for training 76 | """ 77 | logger = get_logger('Mean Activity', 'mean.log') 78 | RGB = np.zeros((3,)) 79 | lock = Lock() 80 | def mean_activity_folder(base_dir): 81 | _RGB = np.zeros((3,)) 82 | logger.info("Starting directory: %s", base_dir) 83 | for image in os.listdir(base_dir): 84 | img = Image.open(os.path.join(base_dir, 85 | image)) 86 | img = resize(img) 87 | 88 | npimg = np.array(img) 89 | _RGB += npimg.mean(axis=(0,1)) 90 | 91 | with lock: 92 | nonlocal RGB 93 | RGB += _RGB 94 | 95 | logger.info("Ending directory: %s", base_dir) 96 | 97 | count = 0 98 | threads = [] 99 | for i, folder in enumerate(os.listdir(os.path.join(base_dir))): 100 | folder_path = os.path.join(base_dir, folder) 101 | count += len(os.listdir(folder_path)) 102 | thread = Thread(target=mean_activity_folder, 103 | args=(folder_path,)) 104 | thread.start() 105 | threads.append(thread) 106 | if i % 100 == 0: 107 | for t in threads: 108 | t.join() 109 | threads = [] 110 | 111 | for t in threads: 112 | t.join() 113 | 114 | logger.info("RGB: %s, count: %d", str(RGB), count) 115 | RGB /= count 116 | 117 | with open('mean.pkl', 'wb') as handle: 118 | pickle.dump(RGB, handle, protocol=pickle.HIGHEST_PROTOCOL) 119 | 120 | def get_mean_activity(): 121 | """ 122 | Get mean activity for each channel(Red, Gree, Blue) 123 | """ 124 | with open('mean.pkl', 'rb') as handle: 125 | return pickle.load(handle) 126 | 127 | def resize(img): 128 | """ 129 | Resize the image to 256 x 256. 130 | 131 | Rescale the image such that the shorter side will be 132 | 256 and then crop out the central 256 x 256 patch. 133 | """ 134 | # Resize the shorter size to 256 135 | if img.width < 256: 136 | img = img.resize((256, img.height)) 137 | if img.height < 256: 138 | img = img.resize((img.width, 256)) 139 | 140 | # Find the central box 141 | width_mid = img.width // 2 142 | height_mid = img.height // 2 143 | left = width_mid - 128 if width_mid >= 128 else 0 144 | right = width_mid + 128 145 | upper = height_mid - 128 if height_mid >= 128 else 0 146 | lower = height_mid + 128 147 | 148 | # Crop the central 256 x 256 patch of the image 149 | img = img.crop((left, upper, right, lower)) 150 | 151 | # Change the mode to RGB if it is not 152 | if img.mode != 'RGB': 153 | img = img.convert('RGB') 154 | 155 | return img 156 | 157 | def preprocess(function, resize_crop=True): 158 | def crop(image, image_size): 159 | """ 160 | Randomly crop `image_size` of the the `image` 161 | """ 162 | _width, _height = (image.size[0] - image_size[0], 163 | image.size[1] - image_size[1]) 164 | 165 | start_width, start_height = (randint(0, _width), 166 | randint(0, _height)) 167 | 168 | return image.crop((start_width, start_height, 169 | start_width + image_size[0], 170 | start_height + image_size[1])) 171 | 172 | def wrapper(*args, **kwargs): 173 | self = args[0] 174 | 175 | img = function(*args, **kwargs) 176 | if resize_crop: 177 | img = resize(img) 178 | img = crop(img, self.image_size) 179 | img.load() 180 | 181 | npimg = np.asarray(img, dtype = "int32") 182 | # Subtract mean activity from each channel 183 | mean = get_mean_activity() 184 | 185 | return npimg - mean.reshape((1, 1, 3)) 186 | 187 | return wrapper 188 | 189 | class Store: 190 | """ 191 | A store to keep batches of data for deep learning 192 | using threading. 193 | """ 194 | def __init__(self, source, max_qsize): 195 | """ 196 | :param source: It will tell how to get the data. 197 | This is a tuple of function, total size of data for one epoch, 198 | and batch size. The function will be used to get the data 199 | to store 200 | :type source: tuple ==> (function, int, int) 201 | :param max_qsize: Maximum number of batches it can store 202 | """ 203 | self.function, self.data_size, self.batch_size = source 204 | self.max_qsize = max_qsize 205 | self.queue = Queue(max_qsize) 206 | self.logger = logging.getLogger('AlexNet.utils.Store') 207 | 208 | def _write(self, i): 209 | """ 210 | Helper function to pass to the thread class to read data parallelly 211 | """ 212 | X, Y = self.function(i) 213 | self.queue.put((X, Y)) 214 | self.logger.debug("The batch no %d is stored", i) 215 | 216 | def write(self): 217 | """ 218 | Store datas by using the function given using threading. 219 | 220 | It should read datas from disk parallelly. 221 | """ 222 | threads = [] 223 | for idx in range(ceil(self.data_size / self.batch_size)): 224 | while len(threads) >= self.max_qsize: 225 | for i, t in enumerate(threads): 226 | if not t.is_alive(): 227 | del threads[i] 228 | break 229 | if len(threads) < self.max_qsize: break 230 | time.sleep(.5) 231 | thread = Thread(target=self._write, args=(idx,)) 232 | # don't need to read batches if the main program exits 233 | thread.daemon = True 234 | thread.start() 235 | threads.append(thread) 236 | 237 | def read(self): 238 | """ 239 | Generator to read data from the store. 240 | 241 | Creates a generator to read data from store(not disk). 242 | It first starts reading the data from disk using threading 243 | so that the data in the store is always available while reading. 244 | """ 245 | thread = Thread(target=self.write) 246 | thread.daemon = True 247 | thread.start() 248 | for _ in range(ceil(self.data_size / self.batch_size)): 249 | yield self.queue.get() 250 | 251 | if __name__ == '__main__': 252 | import argparse 253 | parser = argparse.ArgumentParser() 254 | parser.add_argument('image_path', metavar = 'image-path', 255 | help = 'ImageNet train dataset path') 256 | args = parser.parse_args() 257 | 258 | train_path = os.path.join(args.image_path) 259 | random_train_folder = choice(os.listdir(train_path)) 260 | folder_path = os.path.join(train_path, random_train_folder) 261 | random_image = choice(os.listdir(folder_path)) 262 | image_path = os.path.join(folder_path, random_image) 263 | 264 | print("Image path", image_path) 265 | print("Image shape", img2np(image_path).shape) 266 | if not os.path.exists('mean.pkl'): 267 | gen_mean_activity(args.image_path) 268 | print("Mean activity", get_mean_activity()) 269 | -------------------------------------------------------------------------------- /data.py: -------------------------------------------------------------------------------- 1 | #/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # library modules 5 | import os 6 | import logging 7 | 8 | from collections import namedtuple 9 | from random import shuffle 10 | from random import sample 11 | from math import ceil 12 | 13 | # External library modules 14 | import numpy as np 15 | 16 | from scipy.io import loadmat 17 | from PIL import Image 18 | 19 | # local modules 20 | from utils import preprocess 21 | from utils import gen_mean_activity 22 | from utils import Store 23 | from data_augment import augment 24 | 25 | class LSVRC2010: 26 | """ 27 | Read the train data of ILSVRC2010. 28 | 29 | Considering the :py:path: is `~/datasets/ILSVRC2010` 30 | this class assumes the folder structure as follows 31 | 32 | |____devkit-1.0 33 | | |____data 34 | | | |____ILSVRC2010_validation_ground_truth.txt 35 | | | |____meta.mat 36 | |____ILSVRC2010_img_train 37 | | |____n01443537 38 | | | |____n01443537_1.JPEG 39 | |____ILSVRC2010_img_val 40 | | |____ILSVRC2010_val_00000001.JPEG 41 | """ 42 | 43 | def __init__(self, path, batch_size, augment=False): 44 | """ 45 | Find which folder has what kind of images 46 | Find which image belongs to which folder and what category. 47 | 48 | :param path: The directory path for the ILSVRC2010 training data 49 | """ 50 | self.logger = logging.getLogger('AlexNet.LSVRC2010') 51 | self.batch_size = batch_size 52 | self.augment = augment 53 | self.image_size = (227, 227, 3) 54 | 55 | # Directory paths 56 | self.base_dir = path 57 | self.train_dir = os.path.join(path, 'ILSVRC2010_img_train') 58 | self.val_dir = os.path.join(path, 'ILSVRC2010_img_val') 59 | self.test_dir = os.path.join(path, 'ILSVRC2010_img_test') 60 | 61 | # Store the folder name to label info 62 | self.wnid2label = {} 63 | self.gen_labels() 64 | 65 | self.lsvrcid2wnid = {} 66 | self.store_lsvrcid2wnid() 67 | 68 | self.image_names = {} 69 | self.find_image_names() 70 | 71 | self.image_names_val = {} 72 | self.find_image_names_val() 73 | 74 | self.image_names_test = {} 75 | self.find_image_names_test() 76 | 77 | if not os.path.exists('mean.pkl'): 78 | gen_mean_activity(self.train_dir) 79 | 80 | def gen_labels(self): 81 | """ 82 | Store the folder to label map in a dict. 83 | This will be helpful while creating one-hot encodings. 84 | 85 | :Example: 86 | >>> self.folders = ['hi', 'Alex', 'deep'] 87 | >>> self.get_folder_indices() 88 | {'deep': 1, 'hi': 2, 'Alex': 0} 89 | """ 90 | self.wnid2label = dict((folder, i) for i, folder in enumerate(sorted(os.listdir(self.train_dir)))) 91 | self.logger.info("There are %d categories in total", len(self.wnid2label)) 92 | 93 | def store_lsvrcid2wnid(self): 94 | """ 95 | Store the mapping of ILSVRC2010_ID to WNID 96 | 97 | For more information about what ILSVRC2010_ID 98 | and WNID is, read the devkit-1.0 readme 99 | that you can find for ILSVRC2010. 100 | For short, WNID are the folder names in the training 101 | folder and ILSVRC2010_ID is an id that is assigned 102 | to each folder category to uniquely identify the category 103 | for that folder 104 | 105 | After running this you should have 106 | >>> self.lsvrcid2wnid[330] == 'n01910747' 107 | """ 108 | mat = loadmat(os.path.join(self.base_dir, 'devkit-1.0', 109 | 'data', 'meta.mat')) 110 | synsets = mat['synsets'] 111 | 112 | for i in range(len(synsets)): 113 | # matlab datas are not coming nicely for python objects ;) 114 | self.lsvrcid2wnid[synsets[i][0][0][0][0]] = str(synsets[i][0][1][0]) 115 | 116 | def find_image_names(self): 117 | """ 118 | Find category information for all training images. 119 | 120 | For all images that is present in the training directory 121 | find which WNID(folder) and label that image belongs to 122 | and store it in :py:self.image_names: 123 | 124 | If there are 1000 images in folder `f`, then all 125 | images inside `f` are `f_0.JPEG`, `f_1.JPEG`, ..., `f_999.JPEG`. 126 | But not necessarily as `0, 1, 2, ...`(increasing order from 0). 127 | So better to read what files are present in `f` rather than just 128 | assuming that all files are present in increasing order. 129 | """ 130 | # Each folder belongs to a folder and corresponding label 131 | # This label will represent the number in output softmax 132 | # in the AlexNet graph 133 | category = namedtuple('Category', ['folder', 'label']) 134 | for folder in os.listdir(self.train_dir): 135 | for image in os.listdir(os.path.join(self.train_dir, folder)): 136 | self.image_names[image] = category(folder, self.wnid2label[folder]) 137 | 138 | self.logger.info("There are %d total training images in the dataset", 139 | len(self.image_names)) 140 | 141 | def find_image_names_val(self): 142 | """ 143 | Find the label of each validation image 144 | """ 145 | with open(os.path.join(self.base_dir, 'devkit-1.0', 'data', 146 | 'ILSVRC2010_validation_ground_truth.txt')) as f: 147 | for image, lsvrcid in zip(sorted(os.listdir(self.val_dir)), f): 148 | self.image_names_val[image] = \ 149 | self.wnid2label[self.lsvrcid2wnid[int(lsvrcid.strip())]] 150 | 151 | def find_image_names_test(self): 152 | """ 153 | Find the label of each test image 154 | """ 155 | with open(os.path.join(self.base_dir, 'devkit-1.0', 'data', 156 | 'ILSVRC2010_test_ground_truth.txt')) as f: 157 | for image, lsvrcid in zip(sorted(os.listdir(self.test_dir)), f): 158 | self.image_names_test[image] = \ 159 | self.wnid2label[self.lsvrcid2wnid[int(lsvrcid.strip())]] 160 | 161 | def image_path(self, image_name, val=False, test=False): 162 | """ 163 | Return full image path 164 | e.g. ~/datasets/ILSVRC2010/ILSVRC2010_img_train/n03854065/n03854065_297.JPEG 165 | or 166 | e.g. ~/datasets/ILSVRC2010/ILSVRC2010_img_val/ILSVRC2010_val_00000303.JPEG 167 | 168 | :param image_name: The name of the image. e.g. n03854065_297.JPEG 169 | """ 170 | if val: 171 | return os.path.join(self.val_dir, 172 | image_name) 173 | if test: 174 | return os.path.join(self.test_dir, 175 | image_name) 176 | return os.path.join(self.train_dir, 177 | self.image_names[image_name].folder, 178 | image_name) 179 | 180 | def one_hot(self, labels): 181 | """ 182 | Get the one hot encoding of `:py:labels:` 183 | 184 | The size of the output encoding matrix 185 | has to be (batch size x no of categories). 186 | 187 | :param labels: list of labels for current batch 188 | :type labels: `list` 189 | """ 190 | batch_size = len(labels) 191 | 192 | y_hat = np.zeros((batch_size, len(self.wnid2label))) 193 | y_hat[np.arange(batch_size), labels] = 1 194 | 195 | return y_hat 196 | 197 | @preprocess 198 | def get_image(self, image_path): 199 | """ 200 | Get the image in the path `image_path` 201 | """ 202 | return Image.open(image_path) 203 | 204 | def cur_batch_images(self, images, val=False): 205 | """ 206 | Convert all images in `images` to numpy array 207 | 208 | Return numpy size (`:py:self.batch_size:`, 227, 227, 3) 209 | """ 210 | npimages = [] 211 | for image in images: 212 | npimages.append(self.get_image(self.image_path(image, val))) 213 | 214 | return np.array(npimages) 215 | 216 | def cur_batch_labels(self, images, val=False): 217 | """ 218 | Get the one hot encoding for all `images` in one array 219 | """ 220 | labels = [] 221 | for image in images: 222 | if val: 223 | labels.append(self.image_names_val[image]) 224 | else: 225 | labels.append(self.image_names[image].label) 226 | return self.one_hot(labels) 227 | 228 | @property 229 | def gen_batch(self): 230 | """ 231 | A generator which returns `:py:self.batch_size:` of 232 | images(in a numpy array) and corresponding labels 233 | """ 234 | images = list(self.image_names.keys()) 235 | shuffle(images) 236 | def get_batch(idx): 237 | """ 238 | Get current batch of data give batch index. 239 | 240 | :param idx: The batch index in the dataset 241 | """ 242 | self.logger.debug("Reading batch for index: %d", idx) 243 | _images = images[idx * self.batch_size: (idx + 1) * self.batch_size] 244 | X = self.cur_batch_images(_images) 245 | Y = self.cur_batch_labels(_images) 246 | return X, Y 247 | 248 | source = (get_batch, len(self.image_names.keys()), 249 | self.batch_size) 250 | store = Store(source, 10) 251 | 252 | batch = store.read() 253 | for i in range(ceil(len(self.image_names.keys()) / self.batch_size)): 254 | yield next(batch) 255 | 256 | raise StopIteration 257 | 258 | @property 259 | def gen_batch_non_threaded(self): 260 | """ 261 | A generator which returns `:py:self.batch_size:` of 262 | images(in a numpy array) and corresponding labels 263 | """ 264 | images = list(self.image_names.keys()) 265 | shuffle(images) 266 | 267 | for idx in range(ceil(len(images) / self.batch_size)): 268 | _images = images[idx * self.batch_size: (idx + 1) * self.batch_size] 269 | X = self.cur_batch_images(_images) 270 | Y = self.cur_batch_labels(_images) 271 | yield X, Y 272 | 273 | raise StopIteration 274 | 275 | @property 276 | def get_batch_val(self): 277 | """ 278 | A generator which returns `:py:self.batch_size:` of 279 | images(in a numpy array) and corresponding labels 280 | for validation dataset 281 | """ 282 | images = list(self.image_names_val.keys()) 283 | shuffle(images) 284 | 285 | _images = sample(images, self.batch_size) 286 | X = self.cur_batch_images(_images, True) 287 | Y = self.cur_batch_labels(_images, True) 288 | 289 | return X, Y 290 | 291 | def get_5_patches(self, image_path): 292 | """ 293 | Get 5 patches for an image. 294 | 295 | It returns a list of 5 patches(top left, top right, 296 | bottom left, bottom right and center) of an image. 297 | 298 | :param image_path: the path of an image 299 | """ 300 | img = Image.open(image_path) 301 | # Resize the shorter size to 256 302 | if img.width < 256: 303 | img = img.resize((256, img.height)) 304 | if img.height < 256: 305 | img = img.resize((img.width, 256)) 306 | 307 | if img.mode != 'RGB': 308 | img = img.convert('RGB') 309 | 310 | # Take 5 patches(top left, top right, bottom left, bottom right, center) 311 | img_crop = [None] * 5 312 | img_crop[0] = img.crop((0, 0, self.image_size[0], 313 | self.image_size[1])) 314 | img_crop[1] = img.crop((img.width - self.image_size[0], 0, 315 | img.width - self.image_size[0] + self.image_size[1], 316 | self.image_size[1])) 317 | img_crop[2] = img.crop((0, img.height - self.image_size[1], 318 | self.image_size[0], img.height)) 319 | img_crop[3] = img.crop((img.width - self.image_size[0], 320 | img.height - self.image_size[1], 321 | img.width, img.height)) 322 | img_crop[4] = img.crop((img.width // 2 - self.image_size[0] // 2, 323 | img.height // 2 - self.image_size[1] // 2, 324 | img.width // 2 - self.image_size[0] // 2 + self.image_size[0], 325 | img.height // 2 - self.image_size[1] // 2 + self.image_size[1])) 326 | 327 | patches = [None] * 5 328 | for i, img in enumerate(img_crop): 329 | patches[i] = preprocess(lambda self, img: img, False)(self, img_crop[i]) 330 | 331 | return patches 332 | 333 | @property 334 | def gen_batch_test(self): 335 | """ 336 | A generator which will give test images one by one 337 | after doing preproessing. 338 | 339 | For each batch return X, Y 340 | Where X is a list of 5 patches: each patch will have 341 | batch no of images. Y is the labels which size is batch size. 342 | """ 343 | logger_test = logging.getLogger('AlexNetTest.LSVRC2010') 344 | batch_size = 128 345 | images = list(self.image_names_test.keys()) 346 | def get_batch(idx): 347 | """ 348 | Get current batch of data give batch index. 349 | 350 | :param idx: The batch index in the dataset 351 | """ 352 | logger_test.debug("Reading batch for index: %d", idx) 353 | _images = images[idx * batch_size: (idx + 1) * batch_size] 354 | 355 | X = [[] for _ in range(5)] 356 | Y = [] 357 | for image in _images: 358 | patches = self.get_5_patches(self.image_path(image, test=True)) 359 | for i, patch in enumerate(patches): 360 | X[i].append(patch) 361 | Y.append(self.image_names_test[image]) 362 | 363 | for i in range(len(X)): 364 | X[i] = np.array(X[i]) 365 | 366 | return X, np.array(Y) 367 | 368 | source = (get_batch, len(self.image_names_test), batch_size) 369 | store = Store(source, 10) 370 | 371 | batch = store.read() 372 | for i in range(ceil(len(self.image_names_test) / batch_size)): 373 | yield next(batch) 374 | 375 | raise StopIteration 376 | 377 | if __name__ == '__main__': 378 | import argparse 379 | parser = argparse.ArgumentParser() 380 | parser.add_argument('image_path', metavar = 'image-path', 381 | help = 'ImageNet dataset path') 382 | args = parser.parse_args() 383 | 384 | lsvrc2010 = LSVRC2010(args.image_path, 128) 385 | 386 | image_cur_batch = lsvrc2010.gen_batch 387 | first_batch = next(image_cur_batch) 388 | print("The first batch shape:", first_batch[0].shape) 389 | print("The first one hot vector shape:", first_batch[1].shape) 390 | 391 | first_batch = lsvrc2010.get_batch_val 392 | print("The first batch shape:", first_batch[0].shape) 393 | print("The first one hot vector shape:", first_batch[1].shape) 394 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | **Final Edit**: tensorflow version: 1.7.0. The following text is written as per the reference as I was not able to reproduce the result. Key link in the following text: `bias of 1 in fully connected layers introduced dying relu problem `_. Key suggestion from `here `_ 2 | 3 | AlexNet 4 | ======= 5 | 6 | This is the ``tensorflow`` implementation of `this paper `_. For a more efficient implementation for GPU, head over to `here `_. 7 | 8 | Dataset: 9 | 10 | Olga Russakovsky*, Jia Deng*, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg and Li Fei-Fei. (* = equal contribution) **ImageNet Large Scale Visual Recognition Challenge**. arXiv:1409.0575, 2014. `paper `_ | `bibtex `_ 11 | 12 | Dataset info: 13 | 14 | - Link: `ILSVRC2010 `_ 15 | - Training size: *1261406 images* 16 | - Validation size: *50000 images* 17 | - Test size: *150000 images* 18 | - Dataset size: *124 GB* 19 | - GPU: *8 GB* GPU 20 | - GPU Device: Quadro P4000 21 | 22 | To save up time: 23 | 24 | I got one corrupted image: ``n02487347_1956.JPEG``. The error read: ``Can not identify image file '/path/to/image/n02487347_1956.JPEG n02487347_1956.JPEG``. This happened when I read the image using ``PIL``. Before using this code, please make sure you can open ``n02487347_1956.JPEG`` using ``PIL``. If not delete the image. 25 | 26 | How to Run 27 | ========== 28 | 29 | - To train from scratch: ``python model.py --resume False --train true`` 30 | - To resume training: ``python model.py --resume True --train true`` or ``python model.py --train true`` 31 | - To test: ``python model.py --test true`` 32 | 33 | Performance 34 | =========== 35 | 36 | With the model at the commit ``69ef36bccd2e4956f9e1371f453dfd84a9ae2829``, it looks like the model is overfitting substentially. 37 | 38 | Some of the logs: 39 | 40 | .. code:: 41 | 42 | AlexNet - INFO - Time: 0.643425 Epoch: 0 Batch: 7821 Loss: 331154216.161753 Accuracy: 0.002953 43 | AlexNet - INFO - Time: 0.090631 Epoch: 1 Batch: 7821 Loss: 6.830358 Accuracy: 0.002981 44 | AlexNet - INFO - Time: 0.087481 Epoch: 2 Batch: 7821 Loss: 6.830358 Accuracy: 0.002981 45 | AlexNet - INFO - Time: 0.089649 Epoch: 3 Batch: 7821 Loss: 6.830358 Accuracy: 0.002981 46 | 47 | Addition of dropout layer and/or data augmentation: 48 | 49 | The model still overfits even if dropout layers has been added and the accuracies are almost similar to the previous one. After adding data augmentation method: sometime it goes to 100% and sometime it stays at 0% in the first epoch itself. 50 | 51 | By mistakenly I have added ``tf.nn.conv2d`` which doesn't have any activation function by default as in the case for ``tf.contrib.layers.fully_connected`` (default is ``relu``). So it makes sense after 3 epochs there is no improvement in the accuracy. 52 | 53 | Once ``relu`` has been added, the model was looking good. In the first epoch, few batch accuracies were 0.00781, 0.0156 with lot of other batches were 0s. In the second epoch the number of 0s decreased. 54 | 55 | After changing the learning rate to ``0.001``: 56 | 57 | .. code:: 58 | 59 | 2018-08-12 09:33:43,218 - AlexNet.LSVRC2010 - INFO - There are 1000 categories in total 60 | 2018-08-12 09:34:18,758 - AlexNet.LSVRC2010 - INFO - There are 1261405 total training images in the dataset 61 | 2018-08-12 09:34:19,778 - AlexNet - INFO - Creating placeholders for graph... 62 | 2018-08-12 09:34:19,806 - AlexNet - INFO - Creating variables for graph... 63 | 2018-08-12 09:34:19,821 - AlexNet - INFO - Initialize hyper parameters... 64 | 2018-08-12 09:34:19,823 - AlexNet - INFO - Building the graph... 65 | 2018-08-12 09:34:55,227 - AlexNet - INFO - Time: 18.011845 Epoch: 0 Batch: 0 Loss: 111833.523438 Avg loss: 111833.523438 Accuracy: 0.000000 Avg Accuracy: 0.000000 Top 5 Accuracy: 0.003906 66 | 2018-08-12 09:35:01,769 - AlexNet - INFO - ===================Validation=================== 67 | 2018-08-12 09:35:01,769 - AlexNet - INFO - Loss: 111833.523438 Accuracy: 0.003906 Top 5 Accuracy: 0.007812 68 | 2018-08-12 09:35:08,077 - AlexNet - INFO - Time: 12.849736 Epoch: 0 Batch: 10 Loss: 207.790985 Avg loss: 29811.891185 Accuracy: 0.003906 Avg Accuracy: 0.001420 Top 5 Accuracy: 0.011719 69 | 2018-08-12 09:35:12,964 - AlexNet - INFO - Time: 4.886815 Epoch: 0 Batch: 20 Loss: 37.401054 Avg loss: 15659.049957 Accuracy: 0.000000 Avg Accuracy: 0.000930 Top 5 Accuracy: 0.000000 70 | 2018-08-12 09:35:18,125 - AlexNet - INFO - Time: 5.160061 Epoch: 0 Batch: 30 Loss: 8.535903 Avg loss: 10612.695999 Accuracy: 0.003906 Avg Accuracy: 0.001134 Top 5 Accuracy: 0.011719 71 | 2018-08-12 09:35:27,981 - AlexNet - INFO - Time: 9.856055 Epoch: 0 Batch: 40 Loss: 7.088428 Avg loss: 8026.056906 Accuracy: 0.000000 Avg Accuracy: 0.001048 Top 5 Accuracy: 0.035156 72 | 2018-08-12 09:35:35,951 - AlexNet - INFO - Time: 7.969535 Epoch: 0 Batch: 50 Loss: 6.946403 Avg loss: 6453.687260 Accuracy: 0.000000 Avg Accuracy: 0.000996 Top 5 Accuracy: 0.785156 73 | 2018-08-12 09:35:44,153 - AlexNet - INFO - Time: 8.200076 Epoch: 0 Batch: 60 Loss: 6.922817 Avg loss: 5396.842000 Accuracy: 0.000000 Avg Accuracy: 0.001153 Top 5 Accuracy: 0.960938 74 | 2018-08-12 09:35:52,891 - AlexNet - INFO - Time: 8.737850 Epoch: 0 Batch: 70 Loss: 6.912984 Avg loss: 4637.697923 Accuracy: 0.000000 Avg Accuracy: 0.001045 Top 5 Accuracy: 0.988281 75 | 2018-08-12 09:36:01,211 - AlexNet - INFO - Time: 8.319336 Epoch: 0 Batch: 80 Loss: 6.910833 Avg loss: 4065.996093 Accuracy: 0.003906 Avg Accuracy: 0.001061 Top 5 Accuracy: 0.984375 76 | 2018-08-12 09:36:09,668 - AlexNet - INFO - Time: 8.457077 Epoch: 0 Batch: 90 Loss: 6.911587 Avg loss: 3619.943563 Accuracy: 0.000000 Avg Accuracy: 0.000944 Top 5 Accuracy: 0.996094 77 | 2018-08-12 09:36:17,721 - AlexNet - INFO - Time: 8.052173 Epoch: 0 Batch: 100 Loss: 6.911614 Avg loss: 3262.217633 Accuracy: 0.000000 Avg Accuracy: 0.000928 Top 5 Accuracy: 1.000000 78 | 2018-08-12 09:36:25,930 - AlexNet - INFO - Time: 8.208531 Epoch: 0 Batch: 110 Loss: 6.921659 Avg loss: 2968.946785 Accuracy: 0.000000 Avg Accuracy: 0.001056 Top 5 Accuracy: 0.996094 79 | 2018-08-12 09:36:33,839 - AlexNet - INFO - Time: 7.908030 Epoch: 0 Batch: 120 Loss: 6.910044 Avg loss: 2724.150479 Accuracy: 0.000000 Avg Accuracy: 0.001065 Top 5 Accuracy: 0.996094 80 | 2018-08-12 09:36:41,737 - AlexNet - INFO - Time: 7.898355 Epoch: 0 Batch: 130 Loss: 6.896086 Avg loss: 2516.727494 Accuracy: 0.007812 Avg Accuracy: 0.001133 Top 5 Accuracy: 1.000000 81 | 2018-08-12 09:36:49,676 - AlexNet - INFO - Time: 7.937427 Epoch: 0 Batch: 140 Loss: 6.914582 Avg loss: 2338.726179 Accuracy: 0.000000 Avg Accuracy: 0.001108 Top 5 Accuracy: 1.000000 82 | 2018-08-12 09:36:57,978 - AlexNet - INFO - Time: 8.301199 Epoch: 0 Batch: 150 Loss: 6.911684 Avg loss: 2184.301310 Accuracy: 0.000000 Avg Accuracy: 0.001061 Top 5 Accuracy: 1.000000 83 | 2018-08-12 09:37:05,975 - AlexNet - INFO - Time: 7.986927 Epoch: 0 Batch: 160 Loss: 6.908568 Avg loss: 2049.059589 Accuracy: 0.000000 Avg Accuracy: 0.001043 Top 5 Accuracy: 1.000000 84 | 2018-08-12 09:37:14,373 - AlexNet - INFO - Time: 8.396514 Epoch: 0 Batch: 170 Loss: 6.909007 Avg loss: 1929.635595 Accuracy: 0.000000 Avg Accuracy: 0.001051 Top 5 Accuracy: 1.000000 85 | 86 | **The accuracy for current batch is ``0.000`` while the top 5 accuracy is ``1.000``**. That made me check my code for any implementation error (again!). The graph looked fine in ``tensorboard``. I didn't found any error. 87 | 88 | The output of final layer: out of 1000 numbers for a single training example, all are 0s except few (3 or 4). 89 | 90 | The ``relu`` activation function will make any negative numbers to zero. if the final layer produces 997 of them 0s and 3 non 0s, then ``tf.nn.in_top_k`` will think that this example's output is in top5 as all 997 of them are in 4th position. So there is nothing wrong in there, but one problem though, the training will be substantially slow or it might not converge at all. If we would have got considerable amount of non 0s then it would be faster then other known (``tanh``, ``signmoid``) activation function. 91 | 92 | The output layer is producing lot of 0s which means it is producing lot of negative numbers before ``relu`` is applied. 93 | 94 | A couple things can be done: 95 | 96 | 1. Reduce standard deviation to 0.01(currently 0.1), which will make the weights closer to 0 and maybe it will produce some more positive values 97 | 2. Apply local response normalization(not applying currently) and make standard deviation to 0.01 98 | 3. Use L2 regularization methods to penalize the weights for the way they are, in the hope they will be positive, and make standard deviation to 0.01. 99 | 100 | Turns out none of them worked: 101 | 102 | The next thing I could think of is to change the **Optimzer**. I was using ``tf.train.AdamOptimizer`` (as it is more recent and it's faster) but the paper is using **Gradient Descent with Momentum**. After changing the optimizer to ``tf.train.MomentumOptimizer`` *only* didn't improve anything. 103 | 104 | But when I changed the optimizer to ``tf.train.MomentumOptimizer`` *along with* standard deviation to ``0.01``, things started to change. The top 5 accuracy was no longer ``1.000`` in the initial phase of training when top 1 accuracy was ``0.000``. A lot of positive values can also be seen in the output layer. 105 | 106 | .. code:: 107 | 108 | 2018-08-15 07:48:16,518 - AlexNet.LSVRC2010 - INFO - There are 1000 categories in total 109 | 2018-08-15 07:48:19,122 - AlexNet.LSVRC2010 - INFO - There are 1261405 total training images in the dataset 110 | 2018-08-15 07:48:19,276 - AlexNet - INFO - Creating placeholders for graph... 111 | 2018-08-15 07:48:19,286 - AlexNet - INFO - Creating variables for graph... 112 | 2018-08-15 07:48:19,294 - AlexNet - INFO - Initialize hyper parameters... 113 | 2018-08-15 07:48:19,294 - AlexNet - INFO - Building the graph... 114 | 2018-08-15 07:48:31,054 - AlexNet - INFO - Time: 7.554070 Epoch: 0 Batch: 0 Loss: 12.694657 Avg loss: 12.694657 Accuracy: 0.000000 Avg Accuracy: 0.000000 Top 5 Accuracy: 0.000000 115 | 2018-08-15 07:48:33,664 - AlexNet - INFO - Validation - Accuracy: 0.007812 Top 5 Accuracy: 0.007812 116 | 2018-08-15 07:48:36,993 - AlexNet - INFO - Time: 5.938657 Epoch: 0 Batch: 10 Loss: 7.352790 Avg loss: 8.957169 Accuracy: 0.000000 Avg Accuracy: 0.003551 Top 5 Accuracy: 0.000000 117 | 2018-08-15 07:48:39,417 - AlexNet - INFO - Time: 2.423536 Epoch: 0 Batch: 20 Loss: 6.988025 Avg loss: 8.058247 Accuracy: 0.000000 Avg Accuracy: 0.001860 Top 5 Accuracy: 0.000000 118 | 2018-08-15 07:48:41,863 - AlexNet - INFO - Time: 2.445175 Epoch: 0 Batch: 30 Loss: 6.949255 Avg loss: 7.712968 Accuracy: 0.000000 Avg Accuracy: 0.001764 Top 5 Accuracy: 0.000000 119 | 2018-08-15 07:48:44,271 - AlexNet - INFO - Time: 2.406801 Epoch: 0 Batch: 40 Loss: 6.983654 Avg loss: 7.531209 Accuracy: 0.000000 Avg Accuracy: 0.001715 Top 5 Accuracy: 0.000000 120 | 2018-08-15 07:48:46,737 - AlexNet - INFO - Time: 2.465197 Epoch: 0 Batch: 50 Loss: 6.917971 Avg loss: 7.413875 Accuracy: 0.000000 Avg Accuracy: 0.001838 Top 5 Accuracy: 0.000000 121 | 2018-08-15 07:48:49,130 - AlexNet - INFO - Time: 2.392022 Epoch: 0 Batch: 60 Loss: 6.905321 Avg loss: 7.335342 Accuracy: 0.000000 Avg Accuracy: 0.001665 Top 5 Accuracy: 0.007812 122 | 2018-08-15 07:48:51,844 - AlexNet - INFO - Time: 2.713004 Epoch: 0 Batch: 70 Loss: 6.933993 Avg loss: 7.278179 Accuracy: 0.000000 Avg Accuracy: 0.001430 Top 5 Accuracy: 0.000000 123 | 2018-08-15 07:48:54,833 - AlexNet - INFO - Time: 2.988007 Epoch: 0 Batch: 80 Loss: 6.945042 Avg loss: 7.234285 Accuracy: 0.000000 Avg Accuracy: 0.001640 Top 5 Accuracy: 0.000000 124 | 2018-08-15 07:48:57,737 - AlexNet - INFO - Time: 2.903596 Epoch: 0 Batch: 90 Loss: 6.928125 Avg loss: 7.199531 Accuracy: 0.000000 Avg Accuracy: 0.001717 Top 5 Accuracy: 0.000000 125 | 2018-08-15 07:49:00,525 - AlexNet - INFO - Time: 2.787234 Epoch: 0 Batch: 100 Loss: 6.927566 Avg loss: 7.171717 Accuracy: 0.000000 Avg Accuracy: 0.001702 Top 5 Accuracy: 0.000000 126 | 2018-08-15 07:49:03,372 - AlexNet - INFO - Time: 2.845992 Epoch: 0 Batch: 110 Loss: 6.921791 Avg loss: 7.148882 Accuracy: 0.000000 Avg Accuracy: 0.001548 Top 5 Accuracy: 0.000000 127 | 2018-08-15 07:49:06,260 - AlexNet - INFO - Time: 2.888164 Epoch: 0 Batch: 120 Loss: 6.902064 Avg loss: 7.129549 Accuracy: 0.000000 Avg Accuracy: 0.001550 Top 5 Accuracy: 0.023438 128 | 2018-08-15 07:49:09,457 - AlexNet - INFO - Time: 3.196037 Epoch: 0 Batch: 130 Loss: 6.892216 Avg loss: 7.112829 Accuracy: 0.000000 Avg Accuracy: 0.001610 Top 5 Accuracy: 0.023438 129 | 2018-08-15 07:49:12,286 - AlexNet - INFO - Time: 2.828465 Epoch: 0 Batch: 140 Loss: 6.919292 Avg loss: 7.098849 Accuracy: 0.007812 Avg Accuracy: 0.001662 Top 5 Accuracy: 0.007812 130 | 2018-08-15 07:49:15,333 - AlexNet - INFO - Time: 3.046322 Epoch: 0 Batch: 150 Loss: 6.913494 Avg loss: 7.086305 Accuracy: 0.000000 Avg Accuracy: 0.001604 Top 5 Accuracy: 0.000000 131 | 2018-08-15 07:49:18,165 - AlexNet - INFO - Time: 2.831317 Epoch: 0 Batch: 160 Loss: 6.919824 Avg loss: 7.075751 Accuracy: 0.000000 Avg Accuracy: 0.001553 Top 5 Accuracy: 0.000000 132 | 2018-08-15 07:49:20,772 - AlexNet - INFO - Time: 2.606696 Epoch: 0 Batch: 170 Loss: 6.919248 Avg loss: 7.066110 Accuracy: 0.000000 Avg Accuracy: 0.001553 Top 5 Accuracy: 0.000000 133 | 2018-08-15 07:49:23,477 - AlexNet - INFO - Time: 2.704031 Epoch: 0 Batch: 180 Loss: 6.897551 Avg loss: 7.057617 Accuracy: 0.007812 Avg Accuracy: 0.001511 Top 5 Accuracy: 0.015625 134 | 2018-08-15 07:49:26,396 - AlexNet - INFO - Time: 2.918349 Epoch: 0 Batch: 190 Loss: 6.902122 Avg loss: 7.049929 Accuracy: 0.000000 Avg Accuracy: 0.001513 Top 5 Accuracy: 0.007812 135 | 2018-08-15 07:49:29,334 - AlexNet - INFO - Time: 2.930083 Epoch: 0 Batch: 200 Loss: 6.909646 Avg loss: 7.043022 Accuracy: 0.007812 Avg Accuracy: 0.001594 Top 5 Accuracy: 0.007812 136 | 2018-08-15 07:49:32,254 - AlexNet - INFO - Time: 2.918482 Epoch: 0 Batch: 210 Loss: 6.912971 Avg loss: 7.036663 Accuracy: 0.000000 Avg Accuracy: 0.001555 Top 5 Accuracy: 0.000000 137 | 2018-08-15 07:49:35,127 - AlexNet - INFO - Time: 2.871966 Epoch: 0 Batch: 220 Loss: 6.914743 Avg loss: 7.030835 Accuracy: 0.000000 Avg Accuracy: 0.001555 Top 5 Accuracy: 0.000000 138 | 2018-08-15 07:49:37,802 - AlexNet - INFO - Time: 2.674033 Epoch: 0 Batch: 230 Loss: 6.911674 Avg loss: 7.025807 Accuracy: 0.000000 Avg Accuracy: 0.001488 Top 5 Accuracy: 0.000000 139 | 2018-08-15 07:49:40,728 - AlexNet - INFO - Time: 2.912393 Epoch: 0 Batch: 240 Loss: 6.921112 Avg loss: 7.021023 Accuracy: 0.000000 Avg Accuracy: 0.001491 Top 5 Accuracy: 0.000000 140 | 2018-08-15 07:49:43,599 - AlexNet - INFO - Time: 2.869925 Epoch: 0 Batch: 250 Loss: 6.916319 Avg loss: 7.016570 Accuracy: 0.000000 Avg Accuracy: 0.001463 Top 5 Accuracy: 0.000000 141 | 2018-08-15 07:49:46,381 - AlexNet - INFO - Time: 2.781311 Epoch: 0 Batch: 260 Loss: 6.907039 Avg loss: 7.012589 Accuracy: 0.007812 Avg Accuracy: 0.001437 Top 5 Accuracy: 0.007812 142 | 2018-08-15 07:49:49,391 - AlexNet - INFO - Time: 3.009089 Epoch: 0 Batch: 270 Loss: 6.902983 Avg loss: 7.008793 Accuracy: 0.000000 Avg Accuracy: 0.001413 Top 5 Accuracy: 0.007812 143 | 2018-08-15 07:49:52,207 - AlexNet - INFO - Time: 2.815411 Epoch: 0 Batch: 280 Loss: 6.912594 Avg loss: 7.005259 Accuracy: 0.000000 Avg Accuracy: 0.001390 Top 5 Accuracy: 0.000000 144 | 2018-08-15 07:49:55,066 - AlexNet - INFO - Time: 2.843428 Epoch: 0 Batch: 290 Loss: 6.891138 Avg loss: 7.001918 Accuracy: 0.007812 Avg Accuracy: 0.001369 Top 5 Accuracy: 0.023438 145 | 2018-08-15 07:49:58,272 - AlexNet - INFO - Time: 3.205470 Epoch: 0 Batch: 300 Loss: 6.914747 Avg loss: 6.998840 Accuracy: 0.000000 Avg Accuracy: 0.001402 Top 5 Accuracy: 0.000000 146 | 2018-08-15 07:50:01,100 - AlexNet - INFO - Time: 2.827327 Epoch: 0 Batch: 310 Loss: 6.906322 Avg loss: 6.995992 Accuracy: 0.000000 Avg Accuracy: 0.001382 Top 5 Accuracy: 0.015625 147 | 2018-08-15 07:50:03,924 - AlexNet - INFO - Time: 2.823234 Epoch: 0 Batch: 320 Loss: 6.911921 Avg loss: 6.993308 Accuracy: 0.000000 Avg Accuracy: 0.001387 Top 5 Accuracy: 0.000000 148 | 2018-08-15 07:50:06,715 - AlexNet - INFO - Time: 2.790976 Epoch: 0 Batch: 330 Loss: 6.913865 Avg loss: 6.990783 Accuracy: 0.000000 Avg Accuracy: 0.001369 Top 5 Accuracy: 0.000000 149 | 2018-08-15 07:50:09,480 - AlexNet - INFO - Time: 2.763432 Epoch: 0 Batch: 340 Loss: 6.913737 Avg loss: 6.988495 Accuracy: 0.000000 Avg Accuracy: 0.001352 Top 5 Accuracy: 0.007812 150 | 2018-08-15 07:50:12,447 - AlexNet - INFO - Time: 2.967160 Epoch: 0 Batch: 350 Loss: 6.911568 Avg loss: 6.986181 Accuracy: 0.000000 Avg Accuracy: 0.001358 Top 5 Accuracy: 0.007812 151 | 2018-08-15 07:50:15,123 - AlexNet - INFO - Time: 2.675277 Epoch: 0 Batch: 360 Loss: 6.916988 Avg loss: 6.984106 Accuracy: 0.000000 Avg Accuracy: 0.001320 Top 5 Accuracy: 0.000000 152 | 2018-08-15 07:50:18,022 - AlexNet - INFO - Time: 2.899030 Epoch: 0 Batch: 370 Loss: 6.907708 Avg loss: 6.982115 Accuracy: 0.000000 Avg Accuracy: 0.001306 Top 5 Accuracy: 0.007812 153 | 2018-08-15 07:50:21,034 - AlexNet - INFO - Time: 3.009900 Epoch: 0 Batch: 380 Loss: 6.915299 Avg loss: 6.980155 Accuracy: 0.000000 Avg Accuracy: 0.001271 Top 5 Accuracy: 0.000000 154 | 2018-08-15 07:50:23,871 - AlexNet - INFO - Time: 2.835065 Epoch: 0 Batch: 390 Loss: 6.914540 Avg loss: 6.978238 Accuracy: 0.000000 Avg Accuracy: 0.001299 Top 5 Accuracy: 0.000000 155 | 2018-08-15 07:50:26,741 - AlexNet - INFO - Time: 2.867900 Epoch: 0 Batch: 400 Loss: 6.922895 Avg loss: 6.976529 Accuracy: 0.000000 Avg Accuracy: 0.001364 Top 5 Accuracy: 0.000000 156 | 2018-08-15 07:50:29,574 - AlexNet - INFO - Time: 2.832481 Epoch: 0 Batch: 410 Loss: 6.916379 Avg loss: 6.974939 Accuracy: 0.000000 Avg Accuracy: 0.001331 Top 5 Accuracy: 0.000000 157 | 2018-08-15 07:50:32,332 - AlexNet - INFO - Time: 2.748183 Epoch: 0 Batch: 420 Loss: 6.914469 Avg loss: 6.973401 Accuracy: 0.000000 Avg Accuracy: 0.001299 Top 5 Accuracy: 0.000000 158 | 2018-08-15 07:50:35,288 - AlexNet - INFO - Time: 2.954412 Epoch: 0 Batch: 430 Loss: 6.912920 Avg loss: 6.971925 Accuracy: 0.000000 Avg Accuracy: 0.001269 Top 5 Accuracy: 0.000000 159 | 2018-08-15 07:50:38,041 - AlexNet - INFO - Time: 2.752243 Epoch: 0 Batch: 440 Loss: 6.905376 Avg loss: 6.970463 Accuracy: 0.000000 Avg Accuracy: 0.001276 Top 5 Accuracy: 0.015625 160 | 2018-08-15 07:50:41,128 - AlexNet - INFO - Time: 3.087069 Epoch: 0 Batch: 450 Loss: 6.909246 Avg loss: 6.969112 Accuracy: 0.000000 Avg Accuracy: 0.001265 Top 5 Accuracy: 0.007812 161 | 2018-08-15 07:50:44,073 - AlexNet - INFO - Time: 2.942974 Epoch: 0 Batch: 460 Loss: 6.904259 Avg loss: 6.967809 Accuracy: 0.000000 Avg Accuracy: 0.001271 Top 5 Accuracy: 0.015625 162 | 2018-08-15 07:50:47,071 - AlexNet - INFO - Time: 2.997020 Epoch: 0 Batch: 470 Loss: 6.907288 Avg loss: 6.966543 Accuracy: 0.000000 Avg Accuracy: 0.001310 Top 5 Accuracy: 0.007812 163 | 2018-08-15 07:50:49,881 - AlexNet - INFO - Time: 2.809317 Epoch: 0 Batch: 480 Loss: 6.911692 Avg loss: 6.965313 Accuracy: 0.000000 Avg Accuracy: 0.001299 Top 5 Accuracy: 0.000000 164 | 2018-08-15 07:50:53,481 - AlexNet - INFO - Time: 3.600028 Epoch: 0 Batch: 490 Loss: 6.915403 Avg loss: 6.964301 Accuracy: 0.000000 Avg Accuracy: 0.001289 Top 5 Accuracy: 0.000000 165 | 2018-08-15 07:50:56,337 - AlexNet - INFO - Time: 2.855357 Epoch: 0 Batch: 500 Loss: 6.901047 Avg loss: 6.963102 Accuracy: 0.000000 Avg Accuracy: 0.001325 Top 5 Accuracy: 0.031250 166 | 2018-08-15 07:50:59,348 - AlexNet - INFO - Validation - Accuracy: 0.007812 Top 5 Accuracy: 0.015625 167 | 168 | Atleast this will ensure training will not be slower. 169 | 170 | Turns out changing the *optimizer* didn't improve the model, instead it only slowed down training. Near the end of epoch 1, the top 5 accuracy again went to 1.0000. 171 | 172 | Final thing that I searched was `his `_ setting of bias, where he was using ``0`` as bias for fully connected layers. But the paper has strictly mentionied to use 1 as biases in fully connected layers. The model didn't overfit, it didn't create lot of 0s after the end of graph, loss started decreasing really well, accuracies were looking nice!! I don't fully understand at the moment why the bias in fully connected layers caused the problem. I've created a question on `datascience.stackexchange.com `_. If anyone knows how the bias helped the network to learn nicely, please comment or post your answer there! It'll surely help me and other folks who are struggling on the same problem. 173 | 174 | The model has been trained for nearly 2 days. The top5 accuracy for validation were fluctuating between nearly 75% to 80% and top1 accuracy were fluctuating between nearly 50% to 55% at which point I stopped training. 175 | 176 | For the commit ``d0cfd566157d7c12a1e75c102fff2a80b4dc3706``: 177 | 178 | - screenlog.0: The log file after running ``python model.py --train true`` in `screen `_ 179 | - model and logs: `google drive `_ 180 | 181 | Here are the graphs: 182 | 183 | - *red line*: training 184 | - *blue line*: validation 185 | 186 | **top1 accuracy**: 187 | 188 | .. image:: pictures/top1-acc.png 189 | 190 | **top5 accuracy**: 191 | 192 | .. image:: pictures/top5-acc.png 193 | 194 | **loss**: 195 | 196 | .. image:: pictures/loss.png 197 | 198 | *Incase the above graphs are not visible clearly in terms of numbers on Github, please download it to your local computer, it should be clear there.* 199 | 200 | **Note**: Near global step no 300k, I stopped it mistakenly. At that point it was 29 epochs and some hundered batches. But when I started again it started from epoch no 29 and batch no 0(as there wasn't any improvement for the few hundered batches). That's why the graph got little messed up. 201 | 202 | With the current setting I've got the following accuracies for test dataset: 203 | 204 | - Top1 accuracy: **47.9513%** 205 | - Top5 accuracy: **71.8840%** 206 | 207 | **Note**: To increase test accuracy, train the model for more epochs with lowering the learning rate when validation accuracy doesn't improve. 208 | -------------------------------------------------------------------------------- /model.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # library modules 5 | from math import ceil 6 | import json 7 | import time 8 | import os 9 | import threading 10 | 11 | # External library modules 12 | import tensorflow as tf 13 | import numpy as np 14 | 15 | # local modules 16 | from data import LSVRC2010 17 | import logs 18 | 19 | class AlexNet: 20 | """ 21 | A tensorflow implementation of the paper: 22 | `AlexNet `_ 23 | """ 24 | 25 | def __init__(self, path, batch_size, resume): 26 | """ 27 | Build the AlexNet model 28 | """ 29 | self.logger = logs.get_logger() 30 | 31 | self.resume = resume 32 | self.path = path 33 | self.batch_size = batch_size 34 | self.lsvrc2010 = LSVRC2010(self.path, batch_size) 35 | self.num_classes = len(self.lsvrc2010.wnid2label) 36 | 37 | self.lr = 0.001 38 | self.momentum = 0.9 39 | self.lambd = tf.constant(0.0005, name='lambda') 40 | self.input_shape = (None, 227, 227, 3) 41 | self.output_shape = (None, self.num_classes) 42 | 43 | self.logger.info("Creating placeholders for graph...") 44 | self.create_tf_placeholders() 45 | 46 | self.logger.info("Creating variables for graph...") 47 | self.create_tf_variables() 48 | 49 | self.logger.info("Initialize hyper parameters...") 50 | self.hyper_param = {} 51 | self.init_hyper_param() 52 | 53 | def create_tf_placeholders(self): 54 | """ 55 | Create placeholders for the graph. 56 | The input for these will be given while training or testing. 57 | """ 58 | self.input_image = tf.placeholder(tf.float32, shape=self.input_shape, 59 | name='input_image') 60 | self.labels = tf.placeholder(tf.float32, shape=self.output_shape, 61 | name='output') 62 | self.learning_rate = tf.placeholder(tf.float32, shape=(), 63 | name='learning_rate') 64 | self.dropout = tf.placeholder(tf.float32, shape=(), 65 | name='dropout') 66 | 67 | def create_tf_variables(self): 68 | """ 69 | Create variables for epoch, batch and global step 70 | """ 71 | self.global_step = tf.Variable(0, name='global_step', trainable=False) 72 | self.cur_epoch = tf.Variable(0, name='epoch', trainable=False) 73 | self.cur_batch = tf.Variable(0, name='batch', trainable=False) 74 | 75 | self.increment_epoch_op = tf.assign(self.cur_epoch, self.cur_epoch+1) 76 | self.increment_batch_op = tf.assign(self.cur_batch, self.cur_batch+1) 77 | self.init_batch_op = tf.assign(self.cur_batch, 0) 78 | 79 | def init_hyper_param(self): 80 | """ 81 | Store the hyper parameters. 82 | For each layer store number of filters(kernels) 83 | and filter size. 84 | If it's a fully connected layer then store the number of neurons. 85 | """ 86 | with open('hparam.json') as f: 87 | self.hyper_param = json.load(f) 88 | 89 | def get_filter(self, layer_num, layer_name): 90 | """ 91 | :param layer_num: Indicates the layer number in the graph 92 | :type layer_num: int 93 | :param layer_name: Name of the filter 94 | """ 95 | layer = 'L' + str(layer_num) 96 | 97 | filter_height, filter_width, in_channels = self.hyper_param[layer]['filter_size'] 98 | out_channels = self.hyper_param[layer]['filters'] 99 | 100 | return tf.Variable(tf.truncated_normal( 101 | [filter_height, filter_width, in_channels, out_channels], 102 | dtype = tf.float32, stddev = 1e-2), name = layer_name) 103 | 104 | def get_strides(self, layer_num): 105 | """ 106 | :param layer_num: Indicates the layer number in the graph 107 | :type layer_num: int 108 | """ 109 | layer = 'L' + str(layer_num) 110 | 111 | stride = self.hyper_param[layer]['stride'] 112 | strides = [1, stride, stride, 1] 113 | 114 | return strides 115 | 116 | def get_bias(self, layer_num, value=0.0): 117 | """ 118 | Get the bias variable for current layer 119 | 120 | :param layer_num: Indicates the layer number in the graph 121 | :type layer_num: int 122 | """ 123 | layer = 'L' + str(layer_num) 124 | initial = tf.constant(value, 125 | shape=[self.hyper_param[layer]['filters']], 126 | name='C' + str(layer_num)) 127 | return tf.Variable(initial, name='B' + str(layer_num)) 128 | 129 | @property 130 | def l2_loss(self): 131 | """ 132 | Compute the l2 loss for all the weights 133 | """ 134 | conv_bias_names = ['B' + str(i) for i in range(1, 6)] 135 | weights = [] 136 | for v in tf.trainable_variables(): 137 | if 'biases' in v.name: continue 138 | if v.name.split(':')[0] in conv_bias_names: continue 139 | weights.append(v) 140 | 141 | return self.lambd * tf.add_n([tf.nn.l2_loss(weight) for weight in weights]) 142 | 143 | def build_graph(self): 144 | """ 145 | Build the tensorflow graph for AlexNet. 146 | 147 | First 5 layers are Convolutional layers. Out of which 148 | first 2 and last layer will be followed by *max pooling* 149 | layers. 150 | 151 | Next 2 layers are fully connected layers. 152 | 153 | L1_conv -> L1_MP -> L2_conv -> L2_MP -> L3_conv 154 | -> L4_conv -> L5_conv -> L5_MP -> L6_FC -> L7_FC 155 | 156 | Where L1_conv -> Convolutional layer 1 157 | L5_MP -> Max pooling layer 5 158 | L7_FC -> Fully Connected layer 7 159 | 160 | Use `tf.nn.conv2d` to initialize the filters so 161 | as to reduce training time and `tf.layers.max_pooling2d` 162 | as we don't need to initialize in the pooling layer. 163 | """ 164 | # Layer 1 Convolutional layer 165 | filter1 = self.get_filter(1, 'L1_filter') 166 | l1_conv = tf.nn.conv2d(self.input_image, filter1, 167 | self.get_strides(1), 168 | padding = self.hyper_param['L1']['padding'], 169 | name='L1_conv') 170 | l1_conv = tf.add(l1_conv, self.get_bias(1)) 171 | l1_conv = tf.nn.local_response_normalization(l1_conv, 172 | depth_radius=5, 173 | bias=2, 174 | alpha=1e-4, 175 | beta=.75) 176 | l1_conv = tf.nn.relu(l1_conv) 177 | 178 | # Layer 1 Max Pooling layer 179 | l1_MP = tf.layers.max_pooling2d(l1_conv, 180 | self.hyper_param['L1_MP']['filter_size'], 181 | self.hyper_param['L1_MP']['stride'], 182 | name='L1_MP') 183 | 184 | # Layer 2 Convolutional layer 185 | filter2 = self.get_filter(2, 'L2_filter') 186 | l2_conv = tf.nn.conv2d(l1_MP, filter2, 187 | self.get_strides(2), 188 | padding = self.hyper_param['L2']['padding'], 189 | name='L2_conv') 190 | l2_conv = tf.add(l2_conv, self.get_bias(2, 1.0)) 191 | l2_conv = tf.nn.local_response_normalization(l2_conv, 192 | depth_radius=5, 193 | bias=2, 194 | alpha=1e-4, 195 | beta=.75) 196 | l2_conv = tf.nn.relu(l2_conv) 197 | 198 | # Layer 2 Max Pooling layer 199 | l2_MP = tf.layers.max_pooling2d(l2_conv, 200 | self.hyper_param['L2_MP']['filter_size'], 201 | self.hyper_param['L2_MP']['stride'], 202 | name='L2_MP') 203 | 204 | # Layer 3 Convolutional layer 205 | filter3 = self.get_filter(3, 'L3_filter') 206 | l3_conv = tf.nn.conv2d(l2_MP, filter3, 207 | self.get_strides(3), 208 | padding = self.hyper_param['L3']['padding'], 209 | name='L3_conv') 210 | l3_conv = tf.add(l3_conv, self.get_bias(3)) 211 | l3_conv = tf.nn.relu(l3_conv) 212 | 213 | # Layer 4 Convolutional layer 214 | filter4 = self.get_filter(4, 'L4_filter') 215 | l4_conv = tf.nn.conv2d(l3_conv, filter4, 216 | self.get_strides(4), 217 | padding = self.hyper_param['L4']['padding'], 218 | name='L4_conv') 219 | l4_conv = tf.add(l4_conv, self.get_bias(4, 1.0)) 220 | l4_conv = tf.nn.relu(l4_conv) 221 | 222 | # Layer 5 Convolutional layer 223 | filter5 = self.get_filter(5, 'L5_filter') 224 | l5_conv = tf.nn.conv2d(l4_conv, filter5, 225 | self.get_strides(5), 226 | padding = self.hyper_param['L5']['padding'], 227 | name='L5_conv') 228 | l5_conv = tf.add(l5_conv, self.get_bias(5, 1.0)) 229 | l5_conv = tf.nn.relu(l5_conv) 230 | 231 | # Layer 5 Max Pooling layer 232 | l5_MP = tf.layers.max_pooling2d(l5_conv, 233 | self.hyper_param['L5_MP']['filter_size'], 234 | self.hyper_param['L5_MP']['stride'], 235 | name='L5_MP') 236 | 237 | flatten = tf.layers.flatten(l5_MP) 238 | 239 | # Layer 6 Fully connected layer 240 | l6_FC = tf.contrib.layers.fully_connected(flatten, 241 | self.hyper_param['FC6']) 242 | 243 | # Dropout layer 244 | l6_dropout = tf.nn.dropout(l6_FC, self.dropout, 245 | name='l6_dropout') 246 | 247 | # Layer 7 Fully connected layer 248 | self.l7_FC = tf.contrib.layers.fully_connected(l6_dropout, 249 | self.hyper_param['FC7']) 250 | 251 | # Dropout layer 252 | l7_dropout = tf.nn.dropout(self.l7_FC, self.dropout, 253 | name='l7_dropout') 254 | 255 | # final layer before softmax 256 | self.logits = tf.contrib.layers.fully_connected(l7_dropout, 257 | self.num_classes, None) 258 | 259 | # loss function 260 | loss_function = tf.nn.softmax_cross_entropy_with_logits( 261 | logits = self.logits, 262 | labels = self.labels 263 | ) 264 | 265 | # total loss 266 | self.loss = tf.reduce_mean(loss_function) + self.l2_loss 267 | 268 | self.optimizer = tf.train.MomentumOptimizer(self.learning_rate, momentum=self.momentum)\ 269 | .minimize(self.loss, global_step=self.global_step) 270 | 271 | correct = tf.equal(tf.argmax(self.logits, 1), tf.argmax(self.labels, 1)) 272 | self.accuracy = tf.reduce_mean(tf.cast(correct, tf.float32)) 273 | 274 | self.top5_correct = tf.nn.in_top_k(self.logits, tf.argmax(self.labels, 1), 5) 275 | self.top5_accuracy = tf.reduce_mean(tf.cast(self.top5_correct, tf.float32)) 276 | 277 | self.add_summaries() 278 | 279 | def add_summaries(self): 280 | """ 281 | Add summaries for loss, top1 and top5 accuracies 282 | 283 | Add loss, top1 and top5 accuracies to summary files 284 | in order to visualize in tensorboard 285 | """ 286 | tf.summary.scalar('loss', self.loss) 287 | tf.summary.scalar('Top-1-Acc', self.accuracy) 288 | tf.summary.scalar('Top-5-Acc', self.top5_accuracy) 289 | 290 | self.merged = tf.summary.merge_all() 291 | 292 | def save_model(self, sess, saver): 293 | """ 294 | Save the current model 295 | 296 | :param sess: Session object 297 | :param saver: Saver object responsible to store 298 | """ 299 | model_base_path = os.path.join(os.getcwd(), 'model') 300 | if not os.path.exists(model_base_path): 301 | os.mkdir(model_base_path) 302 | model_save_path = os.path.join(os.getcwd(), 'model', 'model.ckpt') 303 | save_path = saver.save(sess, model_save_path) 304 | self.logger.info("Model saved in path: %s", save_path) 305 | 306 | def restore_model(self, sess, saver): 307 | """ 308 | Restore previously saved model 309 | 310 | :param sess: Session object 311 | :param saver: Saver object responsible to store 312 | """ 313 | model_base_path = os.path.join(os.getcwd(), 'model') 314 | model_restore_path = os.path.join(os.getcwd(), 'model', 'model.ckpt') 315 | saver.restore(sess, model_restore_path) 316 | self.logger.info("Model Restored from path: %s", 317 | model_restore_path) 318 | 319 | def get_summary_writer(self, sess): 320 | """ 321 | Get summary writer for training and validation 322 | 323 | Responsible for creating summary writer so it can 324 | write summaries to a file so it can be read by 325 | tensorboard later. 326 | """ 327 | if not os.path.exists(os.path.join('summary', 'train')): 328 | os.makedirs(os.path.join('summary', 'train')) 329 | if not os.path.exists(os.path.join('summary', 'val')): 330 | os.makedirs(os.path.join('summary', 'val')) 331 | return (tf.summary.FileWriter(os.path.join(os.getcwd(), 332 | 'summary', 'train'), 333 | sess.graph), 334 | tf.summary.FileWriter(os.path.join(os.getcwd(), 335 | 'summary', 'val'), 336 | sess.graph)) 337 | 338 | def train(self, epochs, thread='false'): 339 | """ 340 | Train AlexNet. 341 | """ 342 | batch_step, val_step = 10, 500 343 | 344 | self.logger.info("Building the graph...") 345 | self.build_graph() 346 | 347 | init = tf.global_variables_initializer() 348 | 349 | saver = tf.train.Saver() 350 | with tf.Session(config=tf.ConfigProto(log_device_placement=True)) as sess: 351 | (summary_writer_train, 352 | summary_writer_val) = self.get_summary_writer(sess) 353 | if self.resume and os.path.exists(os.path.join(os.getcwd(), 354 | 'model')): 355 | self.restore_model(sess, saver) 356 | else: 357 | sess.run(init) 358 | 359 | resume_batch = True 360 | best_loss = float('inf') 361 | while sess.run(self.cur_epoch) < epochs: 362 | losses = [] 363 | accuracies = [] 364 | 365 | epoch = sess.run(self.cur_epoch) 366 | if not self.resume or ( 367 | self.resume and not resume_batch): 368 | sess.run(self.init_batch_op) 369 | resume_batch = False 370 | start = time.time() 371 | gen_batch = self.lsvrc2010.gen_batch 372 | for images, labels in gen_batch: 373 | batch_i = sess.run(self.cur_batch) 374 | # If it's resumed from stored model, 375 | # this will save from messing up the batch number 376 | # in subsequent epoch 377 | if batch_i >= ceil(len(self.lsvrc2010.image_names) / self.batch_size): 378 | break 379 | (_, global_step, 380 | _) = sess.run([self.optimizer, 381 | self.global_step, self.increment_batch_op], 382 | feed_dict = { 383 | self.input_image: images, 384 | self.labels: labels, 385 | self.learning_rate: self.lr, 386 | self.dropout: 0.5 387 | }) 388 | 389 | if global_step == 150000: 390 | self.lr = 0.0001 # Halve the learning rate 391 | 392 | if batch_i % batch_step == 0: 393 | (summary, loss, acc, top5_acc, _top5, 394 | logits, l7_FC) = sess.run([self.merged, self.loss, 395 | self.accuracy, self.top5_accuracy, 396 | self.top5_correct, 397 | self.logits, self.l7_FC], 398 | feed_dict = { 399 | self.input_image: images, 400 | self.labels: labels, 401 | self.learning_rate: self.lr, 402 | self.dropout: 1.0 403 | }) 404 | losses.append(loss) 405 | accuracies.append(acc) 406 | summary_writer_train.add_summary(summary, global_step) 407 | summary_writer_train.flush() 408 | end = time.time() 409 | try: 410 | self.logger.debug("l7 no of non zeros: %d", np.count_nonzero(l7_FC)) 411 | true_idx = np.where(_top5[0]==True)[0][0] 412 | self.logger.debug("logit at %d: %s", true_idx, 413 | str(logits[true_idx])) 414 | except IndexError as ie: 415 | self.logger.debug(ie) 416 | self.logger.info("Time: %f Epoch: %d Batch: %d Loss: %f " 417 | "Avg loss: %f Accuracy: %f Avg Accuracy: %f " 418 | "Top 5 Accuracy: %f", 419 | end - start, epoch, batch_i, 420 | loss, sum(losses) / len(losses), 421 | acc, sum(accuracies) / len(accuracies), 422 | top5_acc) 423 | start = time.time() 424 | 425 | if batch_i % val_step == 0: 426 | images_val, labels_val = self.lsvrc2010.get_batch_val 427 | (summary, acc, top5_acc, 428 | loss) = sess.run([self.merged, 429 | self.accuracy, 430 | self.top5_accuracy, self.loss], 431 | feed_dict = { 432 | self.input_image: images_val, 433 | self.labels: labels_val, 434 | self.learning_rate: self.lr, 435 | self.dropout: 1.0 436 | }) 437 | summary_writer_val.add_summary(summary, global_step) 438 | summary_writer_val.flush() 439 | self.logger.info("Validation - Accuracy: %f Top 5 Accuracy: %f Loss: %f", 440 | acc, top5_acc, loss) 441 | 442 | cur_loss = sum(losses) / len(losses) 443 | if cur_loss < best_loss: 444 | best_loss = cur_loss 445 | self.save_model(sess, saver) 446 | 447 | # Increase epoch number 448 | sess.run(self.increment_epoch_op) 449 | 450 | def test(self): 451 | step = 10 452 | 453 | self.logger_test = logs.get_logger('AlexNetTest', file_name='logs_test.log') 454 | self.logger_test.info("In Test: Building the graph...") 455 | self.build_graph() 456 | 457 | init = tf.global_variables_initializer() 458 | 459 | saver = tf.train.Saver() 460 | top1_count, top5_count, count = 0, 0, 0 461 | with tf.Session(config=tf.ConfigProto(log_device_placement=True)) as sess: 462 | self.restore_model(sess, saver) 463 | 464 | start = time.time() 465 | batch = self.lsvrc2010.gen_batch_test 466 | for i, (patches, labels) in enumerate(batch): 467 | count += patches[0].shape[0] 468 | avg_logits = np.zeros((patches[0].shape[0], self.num_classes)) 469 | for patch in patches: 470 | logits = sess.run(self.logits, 471 | feed_dict = { 472 | self.input_image: patch, 473 | self.dropout: 1.0 474 | }) 475 | avg_logits += logits 476 | avg_logits /= len(patches) 477 | top1_count += np.sum(np.argmax(avg_logits, 1) == labels) 478 | top5_count += np.sum(avg_logits.argsort()[:, -5:] == \ 479 | np.repeat(labels, 5).reshape(patches[0].shape[0], 5)) 480 | 481 | if i % step == 0: 482 | end = time.time() 483 | self.logger_test.info("Time: %f Step: %d " 484 | "Avg Accuracy: %f " 485 | "Avg Top 5 Accuracy: %f", 486 | end - start, i, 487 | top1_count / count, 488 | top5_count / count) 489 | start = time.time() 490 | 491 | self.logger_test.info("Final - Avg Accuracy: %f " 492 | "Avg Top 5 Accuracy: %f", 493 | top1_count / count, 494 | top5_count / count) 495 | 496 | if __name__ == '__main__': 497 | import argparse 498 | parser = argparse.ArgumentParser() 499 | parser.add_argument('image_path', metavar = 'image-path', 500 | help = 'ImageNet dataset path') 501 | parser.add_argument('--resume', metavar='resume', 502 | type=lambda x: x != 'False', default=True, 503 | required=False, 504 | help='Resume training (True or False)') 505 | parser.add_argument('--train', help='Train AlexNet') 506 | parser.add_argument('--test', help='Test AlexNet') 507 | args = parser.parse_args() 508 | 509 | alexnet = AlexNet(args.image_path, batch_size=128, resume=args.resume) 510 | 511 | if args.train == 'true': 512 | alexnet.train(50) 513 | elif args.test == 'true': 514 | alexnet.test() 515 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /screenlog_test.0: -------------------------------------------------------------------------------- 1 | sh runalex.sh 2 | 2018-08-27 13:00:37,307 - AlexNet.LSVRC2010 - INFO - There are 1000 categories in total 3 | 2018-08-27 13:00:40,347 - AlexNet.LSVRC2010 - INFO - There are 1261405 total training images in the dataset 4 | 2018-08-27 13:00:41,170 - AlexNet - INFO - Creating placeholders for graph... 5 | 2018-08-27 13:00:41,184 - AlexNet - INFO - Creating variables for graph... 6 | 2018-08-27 13:00:41,193 - AlexNet - INFO - Initialize hyper parameters... 7 | 2018-08-27 13:00:41,194 - AlexNetTest - INFO - In Test: Building the graph... 8 | Device mapping: 9 | /job:localhost/replica:0/task:0/device:GPU:0 -> device: 0, name: Quadro P4000, pci bus id: 0000:00:05.0, compute capability: 6.1 10 | save/RestoreV2: (RestoreV2): /job:localhost/replica:0/task:0/device:CPU:0 11 | fully_connected_2/biases/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 12 | save/Assign_31: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 13 | fully_connected_2/biases/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 14 | fully_connected_2/biases/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 15 | fully_connected_2/biases/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 16 | fully_connected_2/weights/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 17 | save/Assign_33: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 18 | fully_connected_2/weights/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 19 | fully_connected_2/weights/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 20 | fully_connected_2/weights/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 21 | fully_connected_1/biases/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 22 | save/Assign_27: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 23 | fully_connected_1/biases/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 24 | fully_connected_1/biases/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 25 | fully_connected_1/biases/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 26 | fully_connected_1/weights/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 27 | save/Assign_29: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 28 | fully_connected_1/weights/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 29 | fully_connected_1/weights/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 30 | fully_connected_1/weights/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 31 | fully_connected/biases/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 32 | save/Assign_23: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 33 | fully_connected/biases/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 34 | fully_connected/biases/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 35 | fully_connected/biases/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 36 | fully_connected/weights/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 37 | save/Assign_25: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 38 | fully_connected/weights/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 39 | fully_connected/weights/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 40 | fully_connected/weights/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 41 | B5/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 42 | save/Assign_9: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 43 | B5/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 44 | B5/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 45 | B5/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 46 | L5_filter/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 47 | save/Assign_19: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 48 | L5_filter/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 49 | L5_filter/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 50 | L5_filter/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 51 | B4/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 52 | save/Assign_7: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 53 | B4/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 54 | B4/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 55 | B4/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 56 | L4_filter/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 57 | save/Assign_17: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 58 | L4_filter/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 59 | L4_filter/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 60 | L4_filter/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 61 | B3/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 62 | save/Assign_5: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 63 | B3/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 64 | B3/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 65 | B3/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 66 | L3_filter/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 67 | save/Assign_15: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 68 | L3_filter/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 69 | L3_filter/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 70 | L3_filter/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 71 | B2/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 72 | save/Assign_3: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 73 | B2/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 74 | B2/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 75 | B2/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 76 | L2_filter/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 77 | save/Assign_13: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 78 | L2_filter/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 79 | L2_filter/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 80 | L2_filter/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 81 | B1/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 82 | save/Assign_1: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 83 | B1/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 84 | B1/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 85 | B1/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 86 | L1_filter/Momentum: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 87 | save/Assign_11: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 88 | L1_filter/Momentum/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 89 | L1_filter/Momentum/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 90 | L1_filter/Momentum/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 91 | gradients/Mean_grad/Prod_1: (Prod): /job:localhost/replica:0/task:0/device:GPU:0 92 | gradients/Mean_grad/Maximum: (Maximum): /job:localhost/replica:0/task:0/device:GPU:0 93 | gradients/Fill: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 94 | gradients/add_2_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 95 | gradients/add_2_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 96 | gradients/add_2_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 97 | gradients/Mean_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 98 | softmax_cross_entropy_with_logits_sg/Sub_1: (Sub): /job:localhost/replica:0/task:0/device:GPU:0 99 | softmax_cross_entropy_with_logits_sg/Slice_1/begin: (Pack): /job:localhost/replica:0/task:0/device:GPU:0 100 | softmax_cross_entropy_with_logits_sg/Sub: (Sub): /job:localhost/replica:0/task:0/device:GPU:0 101 | softmax_cross_entropy_with_logits_sg/Slice/begin: (Pack): /job:localhost/replica:0/task:0/device:GPU:0 102 | softmax_cross_entropy_with_logits_sg/Sub_2: (Sub): /job:localhost/replica:0/task:0/device:GPU:0 103 | softmax_cross_entropy_with_logits_sg/Slice_2/size: (Pack): /job:localhost/replica:0/task:0/device:GPU:0 104 | fully_connected_2/biases: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 105 | save/Assign_30: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 106 | fully_connected_2/biases/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 107 | fully_connected_2/biases/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 108 | fully_connected_2/biases/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 109 | fully_connected_2/weights: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 110 | save/Assign_32: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 111 | fully_connected_2/weights/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 112 | L2Loss_7: (L2Loss): /job:localhost/replica:0/task:0/device:GPU:0 113 | fully_connected_2/weights/Initializer/random_uniform/sub: (Sub): /job:localhost/replica:0/task:0/device:GPU:0 114 | fully_connected_2/weights/Initializer/random_uniform/RandomUniform: (RandomUniform): /job:localhost/replica:0/task:0/device:GPU:0 115 | fully_connected_2/weights/Initializer/random_uniform/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 116 | fully_connected_2/weights/Initializer/random_uniform: (Add): /job:localhost/replica:0/task:0/device:GPU:0 117 | fully_connected_2/weights/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 118 | l7_dropout/random_uniform/sub: (Sub): /job:localhost/replica:0/task:0/device:GPU:0 119 | fully_connected_1/biases: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 120 | save/Assign_26: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 121 | fully_connected_1/biases/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 122 | fully_connected_1/biases/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 123 | fully_connected_1/biases/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 124 | fully_connected_1/weights: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 125 | save/Assign_28: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 126 | fully_connected_1/weights/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 127 | L2Loss_6: (L2Loss): /job:localhost/replica:0/task:0/device:GPU:0 128 | fully_connected_1/weights/Initializer/random_uniform/sub: (Sub): /job:localhost/replica:0/task:0/device:GPU:0 129 | fully_connected_1/weights/Initializer/random_uniform/RandomUniform: (RandomUniform): /job:localhost/replica:0/task:0/device:GPU:0 130 | fully_connected_1/weights/Initializer/random_uniform/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 131 | fully_connected_1/weights/Initializer/random_uniform: (Add): /job:localhost/replica:0/task:0/device:GPU:0 132 | fully_connected_1/weights/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 133 | l6_dropout/random_uniform/sub: (Sub): /job:localhost/replica:0/task:0/device:GPU:0 134 | fully_connected/biases: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 135 | save/Assign_22: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 136 | fully_connected/biases/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 137 | fully_connected/biases/Initializer/zeros: (Fill): /job:localhost/replica:0/task:0/device:GPU:0 138 | fully_connected/biases/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 139 | fully_connected/weights: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 140 | save/Assign_24: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 141 | fully_connected/weights/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 142 | L2Loss_5: (L2Loss): /job:localhost/replica:0/task:0/device:GPU:0 143 | fully_connected/weights/Initializer/random_uniform/sub: (Sub): /job:localhost/replica:0/task:0/device:GPU:0 144 | fully_connected/weights/Initializer/random_uniform/RandomUniform: (RandomUniform): /job:localhost/replica:0/task:0/device:GPU:0 145 | fully_connected/weights/Initializer/random_uniform/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 146 | fully_connected/weights/Initializer/random_uniform: (Add): /job:localhost/replica:0/task:0/device:GPU:0 147 | fully_connected/weights/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 148 | B5: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 149 | save/Assign_8: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 150 | B5/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 151 | B5/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 152 | L5_filter: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 153 | save/Assign_18: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 154 | L5_filter/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 155 | L2Loss_4: (L2Loss): /job:localhost/replica:0/task:0/device:GPU:0 156 | truncated_normal_4/TruncatedNormal: (TruncatedNormal): /job:localhost/replica:0/task:0/device:GPU:0 157 | truncated_normal_4/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 158 | truncated_normal_4: (Add): /job:localhost/replica:0/task:0/device:GPU:0 159 | L5_filter/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 160 | B4: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 161 | save/Assign_6: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 162 | B4/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 163 | B4/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 164 | L4_filter: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 165 | save/Assign_16: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 166 | L4_filter/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 167 | L2Loss_3: (L2Loss): /job:localhost/replica:0/task:0/device:GPU:0 168 | truncated_normal_3/TruncatedNormal: (TruncatedNormal): /job:localhost/replica:0/task:0/device:GPU:0 169 | truncated_normal_3/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 170 | truncated_normal_3: (Add): /job:localhost/replica:0/task:0/device:GPU:0 171 | L4_filter/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 172 | B3: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 173 | save/Assign_4: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 174 | B3/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 175 | B3/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 176 | L3_filter: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 177 | save/Assign_14: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 178 | L3_filter/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 179 | L2Loss_2: (L2Loss): /job:localhost/replica:0/task:0/device:GPU:0 180 | truncated_normal_2/TruncatedNormal: (TruncatedNormal): /job:localhost/replica:0/task:0/device:GPU:0 181 | truncated_normal_2/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 182 | truncated_normal_2: (Add): /job:localhost/replica:0/task:0/device:GPU:0 183 | L3_filter/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 184 | B2: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 185 | save/Assign_2: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 186 | B2/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 187 | B2/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 188 | L2_filter: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 189 | save/Assign_12: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 190 | L2_filter/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 191 | L2Loss_1: (L2Loss): /job:localhost/replica:0/task:0/device:GPU:0 192 | truncated_normal_1/TruncatedNormal: (TruncatedNormal): /job:localhost/replica:0/task:0/device:GPU:0 193 | truncated_normal_1/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 194 | truncated_normal_1: (Add): /job:localhost/replica:0/task:0/device:GPU:0 195 | L2_filter/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 196 | B1: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 197 | save/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 198 | B1/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 199 | B1/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 200 | L1_filter: (VariableV2): /job:localhost/replica:0/task:0/device:GPU:0 201 | save/Assign_10: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 202 | L1_filter/read: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 203 | L2Loss: (L2Loss): /job:localhost/replica:0/task:0/device:GPU:0 204 | AddN: (AddN): /job:localhost/replica:0/task:0/device:GPU:0 205 | gradients/mul_grad/Mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 206 | truncated_normal/TruncatedNormal: (TruncatedNormal): /job:localhost/replica:0/task:0/device:GPU:0 207 | truncated_normal/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 208 | truncated_normal: (Add): /job:localhost/replica:0/task:0/device:GPU:0 209 | L1_filter/Assign: (Assign): /job:localhost/replica:0/task:0/device:GPU:0 210 | batch: (VariableV2): /job:localhost/replica:0/task:0/device:CPU:0 211 | save/Assign_20: (Assign): /job:localhost/replica:0/task:0/device:CPU:0 212 | Assign_2: (Assign): /job:localhost/replica:0/task:0/device:CPU:0 213 | batch/read: (Identity): /job:localhost/replica:0/task:0/device:CPU:0 214 | add_1: (Add): /job:localhost/replica:0/task:0/device:GPU:0 215 | Assign_1: (Assign): /job:localhost/replica:0/task:0/device:CPU:0 216 | batch/Assign: (Assign): /job:localhost/replica:0/task:0/device:CPU:0 217 | epoch: (VariableV2): /job:localhost/replica:0/task:0/device:CPU:0 218 | save/Assign_21: (Assign): /job:localhost/replica:0/task:0/device:CPU:0 219 | epoch/read: (Identity): /job:localhost/replica:0/task:0/device:CPU:0 220 | add: (Add): /job:localhost/replica:0/task:0/device:GPU:0 221 | Assign: (Assign): /job:localhost/replica:0/task:0/device:CPU:0 222 | epoch/Assign: (Assign): /job:localhost/replica:0/task:0/device:CPU:0 223 | global_step: (VariableV2): /job:localhost/replica:0/task:0/device:CPU:0 224 | save/Assign_34: (Assign): /job:localhost/replica:0/task:0/device:CPU:0 225 | save/restore_all: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 226 | save/SaveV2: (SaveV2): /job:localhost/replica:0/task:0/device:CPU:0 227 | save/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:CPU:0 228 | global_step/read: (Identity): /job:localhost/replica:0/task:0/device:CPU:0 229 | global_step/Assign: (Assign): /job:localhost/replica:0/task:0/device:CPU:0 230 | init: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 231 | ArgMax_2: (ArgMax): /job:localhost/replica:0/task:0/device:GPU:0 232 | ArgMax_1: (ArgMax): /job:localhost/replica:0/task:0/device:GPU:0 233 | softmax_cross_entropy_with_logits_sg/labels_stop_gradient: (StopGradient): /job:localhost/replica:0/task:0/device:GPU:0 234 | softmax_cross_entropy_with_logits_sg/Shape_2: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 235 | softmax_cross_entropy_with_logits_sg/Slice_1: (Slice): /job:localhost/replica:0/task:0/device:GPU:0 236 | softmax_cross_entropy_with_logits_sg/concat_1: (ConcatV2): /job:localhost/replica:0/task:0/device:GPU:0 237 | softmax_cross_entropy_with_logits_sg/Reshape_1: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 238 | gradients/L1_conv_grad/ShapeN: (ShapeN): /job:localhost/replica:0/task:0/device:GPU:0 239 | L1_conv: (Conv2D): /job:localhost/replica:0/task:0/device:GPU:0 240 | gradients/Add_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 241 | gradients/Add_grad/BroadcastGradientArgs: (BroadcastGradientArgs): /job:localhost/replica:0/task:0/device:GPU:0 242 | Add: (Add): /job:localhost/replica:0/task:0/device:GPU:0 243 | LRN: (LRN): /job:localhost/replica:0/task:0/device:GPU:0 244 | Relu: (Relu): /job:localhost/replica:0/task:0/device:GPU:0 245 | L1_MP/MaxPool: (MaxPool): /job:localhost/replica:0/task:0/device:GPU:0 246 | gradients/L2_conv_grad/ShapeN: (ShapeN): /job:localhost/replica:0/task:0/device:GPU:0 247 | L2_conv: (Conv2D): /job:localhost/replica:0/task:0/device:GPU:0 248 | gradients/Add_1_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 249 | gradients/Add_1_grad/BroadcastGradientArgs: (BroadcastGradientArgs): /job:localhost/replica:0/task:0/device:GPU:0 250 | Add_1: (Add): /job:localhost/replica:0/task:0/device:GPU:0 251 | LRN_1: (LRN): /job:localhost/replica:0/task:0/device:GPU:0 252 | Relu_1: (Relu): /job:localhost/replica:0/task:0/device:GPU:0 253 | L2_MP/MaxPool: (MaxPool): /job:localhost/replica:0/task:0/device:GPU:0 254 | gradients/L3_conv_grad/ShapeN: (ShapeN): /job:localhost/replica:0/task:0/device:GPU:0 255 | L3_conv: (Conv2D): /job:localhost/replica:0/task:0/device:GPU:0 256 | gradients/Add_2_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 257 | gradients/Add_2_grad/BroadcastGradientArgs: (BroadcastGradientArgs): /job:localhost/replica:0/task:0/device:GPU:0 258 | Add_2: (Add): /job:localhost/replica:0/task:0/device:GPU:0 259 | Relu_2: (Relu): /job:localhost/replica:0/task:0/device:GPU:0 260 | gradients/L4_conv_grad/ShapeN: (ShapeN): /job:localhost/replica:0/task:0/device:GPU:0 261 | L4_conv: (Conv2D): /job:localhost/replica:0/task:0/device:GPU:0 262 | gradients/Add_3_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 263 | gradients/Add_3_grad/BroadcastGradientArgs: (BroadcastGradientArgs): /job:localhost/replica:0/task:0/device:GPU:0 264 | Add_3: (Add): /job:localhost/replica:0/task:0/device:GPU:0 265 | Relu_3: (Relu): /job:localhost/replica:0/task:0/device:GPU:0 266 | gradients/L5_conv_grad/ShapeN: (ShapeN): /job:localhost/replica:0/task:0/device:GPU:0 267 | L5_conv: (Conv2D): /job:localhost/replica:0/task:0/device:GPU:0 268 | gradients/Add_4_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 269 | gradients/Add_4_grad/BroadcastGradientArgs: (BroadcastGradientArgs): /job:localhost/replica:0/task:0/device:GPU:0 270 | Add_4: (Add): /job:localhost/replica:0/task:0/device:GPU:0 271 | Relu_4: (Relu): /job:localhost/replica:0/task:0/device:GPU:0 272 | L5_MP/MaxPool: (MaxPool): /job:localhost/replica:0/task:0/device:GPU:0 273 | gradients/flatten/Reshape_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 274 | flatten/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 275 | flatten/strided_slice: (StridedSlice): /job:localhost/replica:0/task:0/device:GPU:0 276 | flatten/Reshape/shape: (Pack): /job:localhost/replica:0/task:0/device:GPU:0 277 | flatten/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 278 | fully_connected/MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0 279 | fully_connected/BiasAdd: (BiasAdd): /job:localhost/replica:0/task:0/device:GPU:0 280 | fully_connected/Relu: (Relu): /job:localhost/replica:0/task:0/device:GPU:0 281 | gradients/l6_dropout/div_grad/Neg: (Neg): /job:localhost/replica:0/task:0/device:GPU:0 282 | gradients/l6_dropout/div_grad/RealDiv_1: (RealDiv): /job:localhost/replica:0/task:0/device:GPU:0 283 | gradients/l6_dropout/div_grad/RealDiv_2: (RealDiv): /job:localhost/replica:0/task:0/device:GPU:0 284 | gradients/l6_dropout/div_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 285 | gradients/l6_dropout/div_grad/BroadcastGradientArgs: (BroadcastGradientArgs): /job:localhost/replica:0/task:0/device:GPU:0 286 | l6_dropout/div: (RealDiv): /job:localhost/replica:0/task:0/device:GPU:0 287 | gradients/l6_dropout/mul_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 288 | l6_dropout/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 289 | l6_dropout/random_uniform/RandomUniform: (RandomUniform): /job:localhost/replica:0/task:0/device:GPU:0 290 | l6_dropout/random_uniform/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 291 | l6_dropout/random_uniform: (Add): /job:localhost/replica:0/task:0/device:GPU:0 292 | l6_dropout/add: (Add): /job:localhost/replica:0/task:0/device:GPU:0 293 | l6_dropout/Floor: (Floor): /job:localhost/replica:0/task:0/device:GPU:0 294 | gradients/l6_dropout/mul_grad/Shape_1: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 295 | gradients/l6_dropout/mul_grad/BroadcastGradientArgs: (BroadcastGradientArgs): /job:localhost/replica:0/task:0/device:GPU:0 296 | l6_dropout/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 297 | fully_connected_1/MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0 298 | fully_connected_1/BiasAdd: (BiasAdd): /job:localhost/replica:0/task:0/device:GPU:0 299 | fully_connected_1/Relu: (Relu): /job:localhost/replica:0/task:0/device:GPU:0 300 | gradients/l7_dropout/div_grad/Neg: (Neg): /job:localhost/replica:0/task:0/device:GPU:0 301 | gradients/l7_dropout/div_grad/RealDiv_1: (RealDiv): /job:localhost/replica:0/task:0/device:GPU:0 302 | gradients/l7_dropout/div_grad/RealDiv_2: (RealDiv): /job:localhost/replica:0/task:0/device:GPU:0 303 | gradients/l7_dropout/div_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 304 | gradients/l7_dropout/div_grad/BroadcastGradientArgs: (BroadcastGradientArgs): /job:localhost/replica:0/task:0/device:GPU:0 305 | l7_dropout/div: (RealDiv): /job:localhost/replica:0/task:0/device:GPU:0 306 | gradients/l7_dropout/mul_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 307 | l7_dropout/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 308 | l7_dropout/random_uniform/RandomUniform: (RandomUniform): /job:localhost/replica:0/task:0/device:GPU:0 309 | l7_dropout/random_uniform/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 310 | l7_dropout/random_uniform: (Add): /job:localhost/replica:0/task:0/device:GPU:0 311 | l7_dropout/add: (Add): /job:localhost/replica:0/task:0/device:GPU:0 312 | l7_dropout/Floor: (Floor): /job:localhost/replica:0/task:0/device:GPU:0 313 | gradients/l7_dropout/mul_grad/Shape_1: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 314 | gradients/l7_dropout/mul_grad/BroadcastGradientArgs: (BroadcastGradientArgs): /job:localhost/replica:0/task:0/device:GPU:0 315 | l7_dropout/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 316 | fully_connected_2/MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0 317 | fully_connected_2/BiasAdd: (BiasAdd): /job:localhost/replica:0/task:0/device:GPU:0 318 | in_top_k/InTopKV2: (InTopKV2): /job:localhost/replica:0/task:0/device:CPU:0 319 | Cast_1: (Cast): /job:localhost/replica:0/task:0/device:GPU:0 320 | Mean_2: (Mean): /job:localhost/replica:0/task:0/device:GPU:0 321 | Top-5-Acc: (ScalarSummary): /job:localhost/replica:0/task:0/device:CPU:0 322 | ArgMax: (ArgMax): /job:localhost/replica:0/task:0/device:GPU:0 323 | Equal: (Equal): /job:localhost/replica:0/task:0/device:GPU:0 324 | Cast: (Cast): /job:localhost/replica:0/task:0/device:GPU:0 325 | Mean_1: (Mean): /job:localhost/replica:0/task:0/device:GPU:0 326 | Top-1-Acc: (ScalarSummary): /job:localhost/replica:0/task:0/device:CPU:0 327 | gradients/softmax_cross_entropy_with_logits_sg/Reshape_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 328 | softmax_cross_entropy_with_logits_sg/Shape_1: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 329 | softmax_cross_entropy_with_logits_sg/Slice: (Slice): /job:localhost/replica:0/task:0/device:GPU:0 330 | softmax_cross_entropy_with_logits_sg/concat: (ConcatV2): /job:localhost/replica:0/task:0/device:GPU:0 331 | softmax_cross_entropy_with_logits_sg/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 332 | gradients/softmax_cross_entropy_with_logits_sg_grad/LogSoftmax: (LogSoftmax): /job:localhost/replica:0/task:0/device:GPU:0 333 | gradients/softmax_cross_entropy_with_logits_sg_grad/Neg: (Neg): /job:localhost/replica:0/task:0/device:GPU:0 334 | softmax_cross_entropy_with_logits_sg: (SoftmaxCrossEntropyWithLogits): /job:localhost/replica:0/task:0/device:GPU:0 335 | gradients/zeros_like: (ZerosLike): /job:localhost/replica:0/task:0/device:GPU:0 336 | gradients/softmax_cross_entropy_with_logits_sg/Reshape_2_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 337 | softmax_cross_entropy_with_logits_sg/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 338 | softmax_cross_entropy_with_logits_sg/Slice_2: (Slice): /job:localhost/replica:0/task:0/device:GPU:0 339 | softmax_cross_entropy_with_logits_sg/Reshape_2: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 340 | gradients/Mean_grad/Shape_1: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 341 | gradients/Mean_grad/Prod: (Prod): /job:localhost/replica:0/task:0/device:GPU:0 342 | gradients/Mean_grad/floordiv: (FloorDiv): /job:localhost/replica:0/task:0/device:GPU:0 343 | gradients/Mean_grad/Cast: (Cast): /job:localhost/replica:0/task:0/device:GPU:0 344 | gradients/Mean_grad/Shape: (Shape): /job:localhost/replica:0/task:0/device:GPU:0 345 | gradients/Mean_grad/Tile: (Tile): /job:localhost/replica:0/task:0/device:GPU:0 346 | gradients/Mean_grad/truediv: (RealDiv): /job:localhost/replica:0/task:0/device:GPU:0 347 | gradients/softmax_cross_entropy_with_logits_sg/Reshape_2_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 348 | gradients/softmax_cross_entropy_with_logits_sg_grad/ExpandDims_1: (ExpandDims): /job:localhost/replica:0/task:0/device:GPU:0 349 | gradients/softmax_cross_entropy_with_logits_sg_grad/mul_1: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 350 | gradients/softmax_cross_entropy_with_logits_sg_grad/ExpandDims: (ExpandDims): /job:localhost/replica:0/task:0/device:GPU:0 351 | gradients/softmax_cross_entropy_with_logits_sg_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 352 | gradients/softmax_cross_entropy_with_logits_sg_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 353 | gradients/softmax_cross_entropy_with_logits_sg_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 354 | gradients/softmax_cross_entropy_with_logits_sg_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 355 | gradients/softmax_cross_entropy_with_logits_sg/Reshape_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 356 | gradients/fully_connected_2/BiasAdd_grad/BiasAddGrad: (BiasAddGrad): /job:localhost/replica:0/task:0/device:GPU:0 357 | gradients/fully_connected_2/BiasAdd_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 358 | gradients/fully_connected_2/BiasAdd_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 359 | Momentum/update_fully_connected_2/biases/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 360 | gradients/fully_connected_2/BiasAdd_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 361 | gradients/fully_connected_2/MatMul_grad/MatMul_1: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0 362 | gradients/fully_connected_2/MatMul_grad/MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0 363 | gradients/fully_connected_2/MatMul_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 364 | gradients/fully_connected_2/MatMul_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 365 | gradients/fully_connected_2/MatMul_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 366 | gradients/l7_dropout/mul_grad/Mul_1: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 367 | gradients/l7_dropout/mul_grad/Sum_1: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 368 | gradients/l7_dropout/mul_grad/Reshape_1: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 369 | gradients/l7_dropout/mul_grad/Mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 370 | gradients/l7_dropout/mul_grad/Sum: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 371 | gradients/l7_dropout/mul_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 372 | gradients/l7_dropout/mul_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 373 | gradients/l7_dropout/mul_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 374 | gradients/l7_dropout/mul_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 375 | gradients/l7_dropout/div_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 376 | gradients/l7_dropout/div_grad/Sum_1: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 377 | gradients/l7_dropout/div_grad/Reshape_1: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 378 | gradients/l7_dropout/div_grad/RealDiv: (RealDiv): /job:localhost/replica:0/task:0/device:GPU:0 379 | gradients/l7_dropout/div_grad/Sum: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 380 | gradients/l7_dropout/div_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 381 | gradients/l7_dropout/div_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 382 | gradients/l7_dropout/div_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 383 | gradients/l7_dropout/div_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 384 | gradients/fully_connected_1/Relu_grad/ReluGrad: (ReluGrad): /job:localhost/replica:0/task:0/device:GPU:0 385 | gradients/fully_connected_1/BiasAdd_grad/BiasAddGrad: (BiasAddGrad): /job:localhost/replica:0/task:0/device:GPU:0 386 | gradients/fully_connected_1/BiasAdd_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 387 | gradients/fully_connected_1/BiasAdd_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 388 | Momentum/update_fully_connected_1/biases/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 389 | gradients/fully_connected_1/BiasAdd_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 390 | gradients/fully_connected_1/MatMul_grad/MatMul_1: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0 391 | gradients/fully_connected_1/MatMul_grad/MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0 392 | gradients/fully_connected_1/MatMul_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 393 | gradients/fully_connected_1/MatMul_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 394 | gradients/fully_connected_1/MatMul_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 395 | gradients/l6_dropout/mul_grad/Mul_1: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 396 | gradients/l6_dropout/mul_grad/Sum_1: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 397 | gradients/l6_dropout/mul_grad/Reshape_1: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 398 | gradients/l6_dropout/mul_grad/Mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 399 | gradients/l6_dropout/mul_grad/Sum: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 400 | gradients/l6_dropout/mul_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 401 | gradients/l6_dropout/mul_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 402 | gradients/l6_dropout/mul_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 403 | gradients/l6_dropout/mul_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 404 | gradients/l6_dropout/div_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 405 | gradients/l6_dropout/div_grad/Sum_1: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 406 | gradients/l6_dropout/div_grad/Reshape_1: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 407 | gradients/l6_dropout/div_grad/RealDiv: (RealDiv): /job:localhost/replica:0/task:0/device:GPU:0 408 | gradients/l6_dropout/div_grad/Sum: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 409 | gradients/l6_dropout/div_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 410 | gradients/l6_dropout/div_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 411 | gradients/l6_dropout/div_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 412 | gradients/l6_dropout/div_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 413 | gradients/fully_connected/Relu_grad/ReluGrad: (ReluGrad): /job:localhost/replica:0/task:0/device:GPU:0 414 | gradients/fully_connected/BiasAdd_grad/BiasAddGrad: (BiasAddGrad): /job:localhost/replica:0/task:0/device:GPU:0 415 | gradients/fully_connected/BiasAdd_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 416 | gradients/fully_connected/BiasAdd_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 417 | Momentum/update_fully_connected/biases/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 418 | gradients/fully_connected/BiasAdd_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 419 | gradients/fully_connected/MatMul_grad/MatMul_1: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0 420 | gradients/fully_connected/MatMul_grad/MatMul: (MatMul): /job:localhost/replica:0/task:0/device:GPU:0 421 | gradients/fully_connected/MatMul_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 422 | gradients/fully_connected/MatMul_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 423 | gradients/fully_connected/MatMul_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 424 | gradients/flatten/Reshape_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 425 | gradients/L5_MP/MaxPool_grad/MaxPoolGrad: (MaxPoolGrad): /job:localhost/replica:0/task:0/device:GPU:0 426 | gradients/Relu_4_grad/ReluGrad: (ReluGrad): /job:localhost/replica:0/task:0/device:GPU:0 427 | gradients/Add_4_grad/Sum_1: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 428 | gradients/Add_4_grad/Reshape_1: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 429 | gradients/Add_4_grad/Sum: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 430 | gradients/Add_4_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 431 | gradients/Add_4_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 432 | gradients/Add_4_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 433 | Momentum/update_B5/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 434 | gradients/Add_4_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 435 | gradients/L5_conv_grad/Conv2DBackpropFilter: (Conv2DBackpropFilter): /job:localhost/replica:0/task:0/device:GPU:0 436 | gradients/L5_conv_grad/Conv2DBackpropInput: (Conv2DBackpropInput): /job:localhost/replica:0/task:0/device:GPU:0 437 | gradients/L5_conv_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 438 | gradients/L5_conv_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 439 | gradients/L5_conv_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 440 | gradients/Relu_3_grad/ReluGrad: (ReluGrad): /job:localhost/replica:0/task:0/device:GPU:0 441 | gradients/Add_3_grad/Sum_1: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 442 | gradients/Add_3_grad/Reshape_1: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 443 | gradients/Add_3_grad/Sum: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 444 | gradients/Add_3_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 445 | gradients/Add_3_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 446 | gradients/Add_3_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 447 | Momentum/update_B4/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 448 | gradients/Add_3_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 449 | gradients/L4_conv_grad/Conv2DBackpropFilter: (Conv2DBackpropFilter): /job:localhost/replica:0/task:0/device:GPU:0 450 | gradients/L4_conv_grad/Conv2DBackpropInput: (Conv2DBackpropInput): /job:localhost/replica:0/task:0/device:GPU:0 451 | gradients/L4_conv_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 452 | gradients/L4_conv_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 453 | gradients/L4_conv_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 454 | gradients/Relu_2_grad/ReluGrad: (ReluGrad): /job:localhost/replica:0/task:0/device:GPU:0 455 | gradients/Add_2_grad/Sum_1: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 456 | gradients/Add_2_grad/Reshape_1: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 457 | gradients/Add_2_grad/Sum: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 458 | gradients/Add_2_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 459 | gradients/Add_2_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 460 | gradients/Add_2_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 461 | Momentum/update_B3/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 462 | gradients/Add_2_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 463 | gradients/L3_conv_grad/Conv2DBackpropFilter: (Conv2DBackpropFilter): /job:localhost/replica:0/task:0/device:GPU:0 464 | gradients/L3_conv_grad/Conv2DBackpropInput: (Conv2DBackpropInput): /job:localhost/replica:0/task:0/device:GPU:0 465 | gradients/L3_conv_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 466 | gradients/L3_conv_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 467 | gradients/L3_conv_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 468 | gradients/L2_MP/MaxPool_grad/MaxPoolGrad: (MaxPoolGrad): /job:localhost/replica:0/task:0/device:GPU:0 469 | gradients/Relu_1_grad/ReluGrad: (ReluGrad): /job:localhost/replica:0/task:0/device:GPU:0 470 | gradients/LRN_1_grad/LRNGrad: (LRNGrad): /job:localhost/replica:0/task:0/device:GPU:0 471 | gradients/Add_1_grad/Sum_1: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 472 | gradients/Add_1_grad/Reshape_1: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 473 | gradients/Add_1_grad/Sum: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 474 | gradients/Add_1_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 475 | gradients/Add_1_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 476 | gradients/Add_1_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 477 | Momentum/update_B2/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 478 | gradients/Add_1_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 479 | gradients/L2_conv_grad/Conv2DBackpropFilter: (Conv2DBackpropFilter): /job:localhost/replica:0/task:0/device:GPU:0 480 | gradients/L2_conv_grad/Conv2DBackpropInput: (Conv2DBackpropInput): /job:localhost/replica:0/task:0/device:GPU:0 481 | gradients/L2_conv_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 482 | gradients/L2_conv_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 483 | gradients/L2_conv_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 484 | gradients/L1_MP/MaxPool_grad/MaxPoolGrad: (MaxPoolGrad): /job:localhost/replica:0/task:0/device:GPU:0 485 | gradients/Relu_grad/ReluGrad: (ReluGrad): /job:localhost/replica:0/task:0/device:GPU:0 486 | gradients/LRN_grad/LRNGrad: (LRNGrad): /job:localhost/replica:0/task:0/device:GPU:0 487 | gradients/Add_grad/Sum_1: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 488 | gradients/Add_grad/Reshape_1: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 489 | gradients/Add_grad/Sum: (Sum): /job:localhost/replica:0/task:0/device:GPU:0 490 | gradients/Add_grad/Reshape: (Reshape): /job:localhost/replica:0/task:0/device:GPU:0 491 | gradients/Add_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 492 | gradients/Add_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 493 | Momentum/update_B1/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 494 | gradients/Add_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 495 | gradients/L1_conv_grad/Conv2DBackpropFilter: (Conv2DBackpropFilter): /job:localhost/replica:0/task:0/device:GPU:0 496 | gradients/L1_conv_grad/Conv2DBackpropInput: (Conv2DBackpropInput): /job:localhost/replica:0/task:0/device:GPU:0 497 | gradients/L1_conv_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 498 | gradients/L1_conv_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 499 | gradients/L1_conv_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 500 | Mean: (Mean): /job:localhost/replica:0/task:0/device:GPU:0 501 | gradients/mul_grad/Mul_1: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 502 | gradients/mul_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 503 | gradients/mul_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 504 | gradients/AddN_grad/tuple/group_deps: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 505 | gradients/AddN_grad/tuple/control_dependency_7: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 506 | gradients/L2Loss_7_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 507 | gradients/AddN: (AddN): /job:localhost/replica:0/task:0/device:GPU:0 508 | Momentum/update_fully_connected_2/weights/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 509 | gradients/AddN_grad/tuple/control_dependency_6: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 510 | gradients/L2Loss_6_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 511 | gradients/AddN_1: (AddN): /job:localhost/replica:0/task:0/device:GPU:0 512 | Momentum/update_fully_connected_1/weights/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 513 | gradients/AddN_grad/tuple/control_dependency_5: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 514 | gradients/L2Loss_5_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 515 | gradients/AddN_2: (AddN): /job:localhost/replica:0/task:0/device:GPU:0 516 | Momentum/update_fully_connected/weights/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 517 | gradients/AddN_grad/tuple/control_dependency_4: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 518 | gradients/L2Loss_4_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 519 | gradients/AddN_3: (AddN): /job:localhost/replica:0/task:0/device:GPU:0 520 | Momentum/update_L5_filter/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 521 | gradients/AddN_grad/tuple/control_dependency_3: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 522 | gradients/L2Loss_3_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 523 | gradients/AddN_4: (AddN): /job:localhost/replica:0/task:0/device:GPU:0 524 | Momentum/update_L4_filter/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 525 | gradients/AddN_grad/tuple/control_dependency_2: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 526 | gradients/L2Loss_2_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 527 | gradients/AddN_5: (AddN): /job:localhost/replica:0/task:0/device:GPU:0 528 | Momentum/update_L3_filter/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 529 | gradients/AddN_grad/tuple/control_dependency_1: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 530 | gradients/L2Loss_1_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 531 | gradients/AddN_6: (AddN): /job:localhost/replica:0/task:0/device:GPU:0 532 | Momentum/update_L2_filter/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 533 | gradients/AddN_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 534 | gradients/L2Loss_grad/mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 535 | gradients/AddN_7: (AddN): /job:localhost/replica:0/task:0/device:GPU:0 536 | Momentum/update_L1_filter/ApplyMomentum: (ApplyMomentum): /job:localhost/replica:0/task:0/device:GPU:0 537 | Momentum/update: (NoOp): /job:localhost/replica:0/task:0/device:GPU:0 538 | Momentum: (AssignAdd): /job:localhost/replica:0/task:0/device:CPU:0 539 | gradients/mul_grad/tuple/control_dependency: (Identity): /job:localhost/replica:0/task:0/device:GPU:0 540 | mul: (Mul): /job:localhost/replica:0/task:0/device:GPU:0 541 | add_2: (Add): /job:localhost/replica:0/task:0/device:GPU:0 542 | loss: (ScalarSummary): /job:localhost/replica:0/task:0/device:CPU:0 543 | Merge/MergeSummary: (MergeSummary): /job:localhost/replica:0/task:0/device:CPU:0 544 | save/RestoreV2/shape_and_slices: (Const): /job:localhost/replica:0/task:0/device:CPU:0 545 | save/RestoreV2/tensor_names: (Const): /job:localhost/replica:0/task:0/device:CPU:0 546 | save/SaveV2/shape_and_slices: (Const): /job:localhost/replica:0/task:0/device:CPU:0 547 | save/SaveV2/tensor_names: (Const): /job:localhost/replica:0/task:0/device:CPU:0 548 | save/Const: (Const): /job:localhost/replica:0/task:0/device:CPU:0 549 | Top-5-Acc/tags: (Const): /job:localhost/replica:0/task:0/device:CPU:0 550 | Top-1-Acc/tags: (Const): /job:localhost/replica:0/task:0/device:CPU:0 551 | loss/tags: (Const): /job:localhost/replica:0/task:0/device:CPU:0 552 | Const_2: (Const): /job:localhost/replica:0/task:0/device:GPU:0 553 | in_top_k/InTopKV2/k: (Const): /job:localhost/replica:0/task:0/device:CPU:0 554 | ArgMax_2/dimension: (Const): /job:localhost/replica:0/task:0/device:GPU:0 555 | Const_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 556 | ArgMax_1/dimension: (Const): /job:localhost/replica:0/task:0/device:GPU:0 557 | ArgMax/dimension: (Const): /job:localhost/replica:0/task:0/device:GPU:0 558 | Momentum/momentum: (Const): /job:localhost/replica:0/task:0/device:GPU:0 559 | fully_connected_2/biases/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 560 | fully_connected_2/biases/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 561 | fully_connected_2/weights/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 562 | fully_connected_2/weights/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 563 | fully_connected_1/biases/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 564 | fully_connected_1/biases/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 565 | fully_connected_1/weights/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 566 | fully_connected_1/weights/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 567 | fully_connected/biases/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 568 | fully_connected/biases/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 569 | fully_connected/weights/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 570 | fully_connected/weights/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 571 | B5/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 572 | B5/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 573 | L5_filter/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 574 | L5_filter/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 575 | B4/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 576 | B4/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 577 | L4_filter/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 578 | L4_filter/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 579 | B3/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 580 | B3/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 581 | L3_filter/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 582 | L3_filter/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 583 | B2/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 584 | B2/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 585 | L2_filter/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 586 | L2_filter/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 587 | B1/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 588 | B1/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 589 | L1_filter/Momentum/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 590 | L1_filter/Momentum/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 591 | gradients/L1_conv_grad/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 592 | gradients/Add_grad/Shape_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 593 | gradients/L2_conv_grad/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 594 | gradients/Add_1_grad/Shape_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 595 | gradients/L3_conv_grad/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 596 | gradients/Add_2_grad/Shape_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 597 | gradients/L4_conv_grad/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 598 | gradients/Add_3_grad/Shape_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 599 | gradients/L5_conv_grad/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 600 | gradients/Add_4_grad/Shape_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 601 | gradients/l6_dropout/div_grad/Shape_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 602 | gradients/l7_dropout/div_grad/Shape_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 603 | gradients/softmax_cross_entropy_with_logits_sg_grad/ExpandDims_1/dim: (Const): /job:localhost/replica:0/task:0/device:GPU:0 604 | gradients/softmax_cross_entropy_with_logits_sg_grad/ExpandDims/dim: (Const): /job:localhost/replica:0/task:0/device:GPU:0 605 | gradients/Mean_grad/Maximum/y: (Const): /job:localhost/replica:0/task:0/device:GPU:0 606 | gradients/Mean_grad/Const_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 607 | gradients/Mean_grad/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 608 | gradients/Mean_grad/Shape_2: (Const): /job:localhost/replica:0/task:0/device:GPU:0 609 | gradients/Mean_grad/Reshape/shape: (Const): /job:localhost/replica:0/task:0/device:GPU:0 610 | gradients/grad_ys_0: (Const): /job:localhost/replica:0/task:0/device:GPU:0 611 | gradients/Shape: (Const): /job:localhost/replica:0/task:0/device:GPU:0 612 | Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 613 | softmax_cross_entropy_with_logits_sg/Slice_2/begin: (Const): /job:localhost/replica:0/task:0/device:GPU:0 614 | softmax_cross_entropy_with_logits_sg/Sub_2/y: (Const): /job:localhost/replica:0/task:0/device:GPU:0 615 | softmax_cross_entropy_with_logits_sg/concat_1/axis: (Const): /job:localhost/replica:0/task:0/device:GPU:0 616 | softmax_cross_entropy_with_logits_sg/concat_1/values_0: (Const): /job:localhost/replica:0/task:0/device:GPU:0 617 | softmax_cross_entropy_with_logits_sg/Slice_1/size: (Const): /job:localhost/replica:0/task:0/device:GPU:0 618 | softmax_cross_entropy_with_logits_sg/Sub_1/y: (Const): /job:localhost/replica:0/task:0/device:GPU:0 619 | softmax_cross_entropy_with_logits_sg/Rank_2: (Const): /job:localhost/replica:0/task:0/device:GPU:0 620 | softmax_cross_entropy_with_logits_sg/concat/axis: (Const): /job:localhost/replica:0/task:0/device:GPU:0 621 | softmax_cross_entropy_with_logits_sg/concat/values_0: (Const): /job:localhost/replica:0/task:0/device:GPU:0 622 | softmax_cross_entropy_with_logits_sg/Slice/size: (Const): /job:localhost/replica:0/task:0/device:GPU:0 623 | softmax_cross_entropy_with_logits_sg/Sub/y: (Const): /job:localhost/replica:0/task:0/device:GPU:0 624 | softmax_cross_entropy_with_logits_sg/Rank_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 625 | softmax_cross_entropy_with_logits_sg/Rank: (Const): /job:localhost/replica:0/task:0/device:GPU:0 626 | fully_connected_2/biases/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 627 | fully_connected_2/biases/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 628 | fully_connected_2/weights/Initializer/random_uniform/max: (Const): /job:localhost/replica:0/task:0/device:GPU:0 629 | fully_connected_2/weights/Initializer/random_uniform/min: (Const): /job:localhost/replica:0/task:0/device:GPU:0 630 | fully_connected_2/weights/Initializer/random_uniform/shape: (Const): /job:localhost/replica:0/task:0/device:GPU:0 631 | l7_dropout/random_uniform/max: (Const): /job:localhost/replica:0/task:0/device:GPU:0 632 | l7_dropout/random_uniform/min: (Const): /job:localhost/replica:0/task:0/device:GPU:0 633 | fully_connected_1/biases/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 634 | fully_connected_1/biases/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 635 | fully_connected_1/weights/Initializer/random_uniform/max: (Const): /job:localhost/replica:0/task:0/device:GPU:0 636 | fully_connected_1/weights/Initializer/random_uniform/min: (Const): /job:localhost/replica:0/task:0/device:GPU:0 637 | fully_connected_1/weights/Initializer/random_uniform/shape: (Const): /job:localhost/replica:0/task:0/device:GPU:0 638 | l6_dropout/random_uniform/max: (Const): /job:localhost/replica:0/task:0/device:GPU:0 639 | l6_dropout/random_uniform/min: (Const): /job:localhost/replica:0/task:0/device:GPU:0 640 | fully_connected/biases/Initializer/zeros/Const: (Const): /job:localhost/replica:0/task:0/device:GPU:0 641 | fully_connected/biases/Initializer/zeros/shape_as_tensor: (Const): /job:localhost/replica:0/task:0/device:GPU:0 642 | fully_connected/weights/Initializer/random_uniform/max: (Const): /job:localhost/replica:0/task:0/device:GPU:0 643 | fully_connected/weights/Initializer/random_uniform/min: (Const): /job:localhost/replica:0/task:0/device:GPU:0 644 | fully_connected/weights/Initializer/random_uniform/shape: (Const): /job:localhost/replica:0/task:0/device:GPU:0 645 | flatten/Reshape/shape/1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 646 | flatten/strided_slice/stack_2: (Const): /job:localhost/replica:0/task:0/device:GPU:0 647 | flatten/strided_slice/stack_1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 648 | flatten/strided_slice/stack: (Const): /job:localhost/replica:0/task:0/device:GPU:0 649 | C5: (Const): /job:localhost/replica:0/task:0/device:GPU:0 650 | truncated_normal_4/stddev: (Const): /job:localhost/replica:0/task:0/device:GPU:0 651 | truncated_normal_4/mean: (Const): /job:localhost/replica:0/task:0/device:GPU:0 652 | truncated_normal_4/shape: (Const): /job:localhost/replica:0/task:0/device:GPU:0 653 | C4: (Const): /job:localhost/replica:0/task:0/device:GPU:0 654 | truncated_normal_3/stddev: (Const): /job:localhost/replica:0/task:0/device:GPU:0 655 | truncated_normal_3/mean: (Const): /job:localhost/replica:0/task:0/device:GPU:0 656 | truncated_normal_3/shape: (Const): /job:localhost/replica:0/task:0/device:GPU:0 657 | C3: (Const): /job:localhost/replica:0/task:0/device:GPU:0 658 | truncated_normal_2/stddev: (Const): /job:localhost/replica:0/task:0/device:GPU:0 659 | truncated_normal_2/mean: (Const): /job:localhost/replica:0/task:0/device:GPU:0 660 | truncated_normal_2/shape: (Const): /job:localhost/replica:0/task:0/device:GPU:0 661 | C2: (Const): /job:localhost/replica:0/task:0/device:GPU:0 662 | truncated_normal_1/stddev: (Const): /job:localhost/replica:0/task:0/device:GPU:0 663 | truncated_normal_1/mean: (Const): /job:localhost/replica:0/task:0/device:GPU:0 664 | truncated_normal_1/shape: (Const): /job:localhost/replica:0/task:0/device:GPU:0 665 | C1: (Const): /job:localhost/replica:0/task:0/device:GPU:0 666 | truncated_normal/stddev: (Const): /job:localhost/replica:0/task:0/device:GPU:0 667 | truncated_normal/mean: (Const): /job:localhost/replica:0/task:0/device:GPU:0 668 | truncated_normal/shape: (Const): /job:localhost/replica:0/task:0/device:GPU:0 669 | Assign_2/value: (Const): /job:localhost/replica:0/task:0/device:CPU:0 670 | add_1/y: (Const): /job:localhost/replica:0/task:0/device:GPU:0 671 | add/y: (Const): /job:localhost/replica:0/task:0/device:GPU:0 672 | batch/initial_value: (Const): /job:localhost/replica:0/task:0/device:CPU:0 673 | epoch/initial_value: (Const): /job:localhost/replica:0/task:0/device:CPU:0 674 | global_step/initial_value: (Const): /job:localhost/replica:0/task:0/device:CPU:0 675 | dropout: (Placeholder): /job:localhost/replica:0/task:0/device:GPU:0 676 | learning_rate: (Placeholder): /job:localhost/replica:0/task:0/device:GPU:0 677 | output: (Placeholder): /job:localhost/replica:0/task:0/device:GPU:0 678 | input_image: (Placeholder): /job:localhost/replica:0/task:0/device:GPU:0 679 | lambda: (Const): /job:localhost/replica:0/task:0/device:GPU:0 680 | Momentum/value: (Const): /job:localhost/replica:0/task:0/device:CPU:0 681 | 2018-08-27 13:00:46,348 - AlexNet - INFO - Model Restored from path: /home/paperspace/Github/AlexNet/model/model.ckpt 682 | 2018-08-27 13:00:55,972 - AlexNetTest - INFO - Time: 9.623876 Step: 0 Avg Accuracy: 0.507812 Avg Top 5 Accuracy: 0.773438 683 | 2018-08-27 13:01:08,983 - AlexNetTest - INFO - Time: 13.004517 Step: 10 Avg Accuracy: 0.490767 Avg Top 5 Accuracy: 0.723722 684 | 2018-08-27 13:01:21,714 - AlexNetTest - INFO - Time: 12.731266 Step: 20 Avg Accuracy: 0.486235 Avg Top 5 Accuracy: 0.717634 685 | 2018-08-27 13:01:34,372 - AlexNetTest - INFO - Time: 12.657613 Step: 30 Avg Accuracy: 0.479839 Avg Top 5 Accuracy: 0.716230 686 | 2018-08-27 13:01:47,234 - AlexNetTest - INFO - Time: 12.861603 Step: 40 Avg Accuracy: 0.481707 Avg Top 5 Accuracy: 0.719512 687 | 2018-08-27 13:01:59,946 - AlexNetTest - INFO - Time: 12.711263 Step: 50 Avg Accuracy: 0.477941 Avg Top 5 Accuracy: 0.717984 688 | 2018-08-27 13:02:12,828 - AlexNetTest - INFO - Time: 12.881901 Step: 60 Avg Accuracy: 0.477075 Avg Top 5 Accuracy: 0.716957 689 | 2018-08-27 13:02:25,725 - AlexNetTest - INFO - Time: 12.896455 Step: 70 Avg Accuracy: 0.479864 Avg Top 5 Accuracy: 0.717320 690 | 2018-08-27 13:02:38,546 - AlexNetTest - INFO - Time: 12.820568 Step: 80 Avg Accuracy: 0.479552 Avg Top 5 Accuracy: 0.716146 691 | 2018-08-27 13:02:51,359 - AlexNetTest - INFO - Time: 12.813020 Step: 90 Avg Accuracy: 0.479825 Avg Top 5 Accuracy: 0.715573 692 | 2018-08-27 13:03:04,218 - AlexNetTest - INFO - Time: 12.859053 Step: 100 Avg Accuracy: 0.481049 Avg Top 5 Accuracy: 0.715811 693 | 2018-08-27 13:03:17,027 - AlexNetTest - INFO - Time: 12.807700 Step: 110 Avg Accuracy: 0.481419 Avg Top 5 Accuracy: 0.715864 694 | 2018-08-27 13:03:29,803 - AlexNetTest - INFO - Time: 12.776304 Step: 120 Avg Accuracy: 0.481082 Avg Top 5 Accuracy: 0.715909 695 | 2018-08-27 13:03:42,670 - AlexNetTest - INFO - Time: 12.866103 Step: 130 Avg Accuracy: 0.479783 Avg Top 5 Accuracy: 0.715351 696 | 2018-08-27 13:03:55,617 - AlexNetTest - INFO - Time: 12.946833 Step: 140 Avg Accuracy: 0.479832 Avg Top 5 Accuracy: 0.715426 697 | 2018-08-27 13:04:08,426 - AlexNetTest - INFO - Time: 12.808140 Step: 150 Avg Accuracy: 0.479719 Avg Top 5 Accuracy: 0.715387 698 | 2018-08-27 13:04:21,397 - AlexNetTest - INFO - Time: 12.971071 Step: 160 Avg Accuracy: 0.480784 Avg Top 5 Accuracy: 0.716712 699 | 2018-08-27 13:04:34,414 - AlexNetTest - INFO - Time: 13.017248 Step: 170 Avg Accuracy: 0.480674 Avg Top 5 Accuracy: 0.716694 700 | 2018-08-27 13:04:47,428 - AlexNetTest - INFO - Time: 13.013196 Step: 180 Avg Accuracy: 0.481397 Avg Top 5 Accuracy: 0.717541 701 | 2018-08-27 13:05:00,274 - AlexNetTest - INFO - Time: 12.845891 Step: 190 Avg Accuracy: 0.480898 Avg Top 5 Accuracy: 0.717032 702 | 2018-08-27 13:05:13,253 - AlexNetTest - INFO - Time: 12.978802 Step: 200 Avg Accuracy: 0.479633 Avg Top 5 Accuracy: 0.716845 703 | 2018-08-27 13:05:26,159 - AlexNetTest - INFO - Time: 12.905031 Step: 210 Avg Accuracy: 0.480450 Avg Top 5 Accuracy: 0.716899 704 | 2018-08-27 13:05:39,274 - AlexNetTest - INFO - Time: 13.114909 Step: 220 Avg Accuracy: 0.480840 Avg Top 5 Accuracy: 0.716417 705 | 2018-08-27 13:05:52,196 - AlexNetTest - INFO - Time: 12.921639 Step: 230 Avg Accuracy: 0.480553 Avg Top 5 Accuracy: 0.716416 706 | 2018-08-27 13:06:05,183 - AlexNetTest - INFO - Time: 12.986690 Step: 240 Avg Accuracy: 0.480582 Avg Top 5 Accuracy: 0.716448 707 | 2018-08-27 13:06:18,201 - AlexNetTest - INFO - Time: 13.017177 Step: 250 Avg Accuracy: 0.480080 Avg Top 5 Accuracy: 0.716135 708 | 2018-08-27 13:06:31,220 - AlexNetTest - INFO - Time: 13.019170 Step: 260 Avg Accuracy: 0.480154 Avg Top 5 Accuracy: 0.716505 709 | 2018-08-27 13:06:44,318 - AlexNetTest - INFO - Time: 13.097467 Step: 270 Avg Accuracy: 0.480541 Avg Top 5 Accuracy: 0.716357 710 | 2018-08-27 13:06:57,460 - AlexNetTest - INFO - Time: 13.141295 Step: 280 Avg Accuracy: 0.480510 Avg Top 5 Accuracy: 0.716303 711 | 2018-08-27 13:07:10,532 - AlexNetTest - INFO - Time: 13.072423 Step: 290 Avg Accuracy: 0.480831 Avg Top 5 Accuracy: 0.716629 712 | 2018-08-27 13:07:23,465 - AlexNetTest - INFO - Time: 12.932523 Step: 300 Avg Accuracy: 0.479937 Avg Top 5 Accuracy: 0.715999 713 | 2018-08-27 13:07:36,490 - AlexNetTest - INFO - Time: 13.024640 Step: 310 Avg Accuracy: 0.479426 Avg Top 5 Accuracy: 0.716238 714 | 2018-08-27 13:07:49,502 - AlexNetTest - INFO - Time: 13.011819 Step: 320 Avg Accuracy: 0.479434 Avg Top 5 Accuracy: 0.716073 715 | 2018-08-27 13:08:02,532 - AlexNetTest - INFO - Time: 13.029433 Step: 330 Avg Accuracy: 0.480103 Avg Top 5 Accuracy: 0.716767 716 | 2018-08-27 13:08:15,559 - AlexNetTest - INFO - Time: 13.026150 Step: 340 Avg Accuracy: 0.480068 Avg Top 5 Accuracy: 0.717536 717 | 2018-08-27 13:08:28,624 - AlexNetTest - INFO - Time: 13.064592 Step: 350 Avg Accuracy: 0.479879 Avg Top 5 Accuracy: 0.717014 718 | 2018-08-27 13:08:41,696 - AlexNetTest - INFO - Time: 13.071948 Step: 360 Avg Accuracy: 0.479874 Avg Top 5 Accuracy: 0.716543 719 | 2018-08-27 13:08:54,629 - AlexNetTest - INFO - Time: 12.932421 Step: 370 Avg Accuracy: 0.480290 Avg Top 5 Accuracy: 0.716981 720 | 2018-08-27 13:09:07,621 - AlexNetTest - INFO - Time: 12.991519 Step: 380 Avg Accuracy: 0.480130 Avg Top 5 Accuracy: 0.716905 721 | 2018-08-27 13:09:20,692 - AlexNetTest - INFO - Time: 13.070202 Step: 390 Avg Accuracy: 0.480119 Avg Top 5 Accuracy: 0.716892 722 | 2018-08-27 13:09:33,733 - AlexNetTest - INFO - Time: 13.040746 Step: 400 Avg Accuracy: 0.479738 Avg Top 5 Accuracy: 0.716743 723 | 2018-08-27 13:09:46,727 - AlexNetTest - INFO - Time: 12.994141 Step: 410 Avg Accuracy: 0.479319 Avg Top 5 Accuracy: 0.716602 724 | 2018-08-27 13:09:59,773 - AlexNetTest - INFO - Time: 13.045878 Step: 420 Avg Accuracy: 0.479476 Avg Top 5 Accuracy: 0.716709 725 | 2018-08-27 13:10:12,793 - AlexNetTest - INFO - Time: 13.019658 Step: 430 Avg Accuracy: 0.479209 Avg Top 5 Accuracy: 0.716466 726 | 2018-08-27 13:10:25,894 - AlexNetTest - INFO - Time: 13.100033 Step: 440 Avg Accuracy: 0.478972 Avg Top 5 Accuracy: 0.716288 727 | 2018-08-27 13:10:38,960 - AlexNetTest - INFO - Time: 13.066127 Step: 450 Avg Accuracy: 0.478572 Avg Top 5 Accuracy: 0.716117 728 | 2018-08-27 13:10:52,003 - AlexNetTest - INFO - Time: 13.042730 Step: 460 Avg Accuracy: 0.478833 Avg Top 5 Accuracy: 0.716462 729 | 2018-08-27 13:11:05,098 - AlexNetTest - INFO - Time: 13.094267 Step: 470 Avg Accuracy: 0.479133 Avg Top 5 Accuracy: 0.716726 730 | 2018-08-27 13:11:18,172 - AlexNetTest - INFO - Time: 13.073300 Step: 480 Avg Accuracy: 0.479210 Avg Top 5 Accuracy: 0.717028 731 | 2018-08-27 13:11:31,243 - AlexNetTest - INFO - Time: 13.071307 Step: 490 Avg Accuracy: 0.479458 Avg Top 5 Accuracy: 0.717398 732 | 2018-08-27 13:11:44,326 - AlexNetTest - INFO - Time: 13.082620 Step: 500 Avg Accuracy: 0.479479 Avg Top 5 Accuracy: 0.717565 733 | 2018-08-27 13:11:57,293 - AlexNetTest - INFO - Time: 12.966326 Step: 510 Avg Accuracy: 0.479406 Avg Top 5 Accuracy: 0.717710 734 | 2018-08-27 13:12:10,415 - AlexNetTest - INFO - Time: 13.122152 Step: 520 Avg Accuracy: 0.479262 Avg Top 5 Accuracy: 0.717430 735 | 2018-08-27 13:12:23,485 - AlexNetTest - INFO - Time: 13.069125 Step: 530 Avg Accuracy: 0.479329 Avg Top 5 Accuracy: 0.717455 736 | 2018-08-27 13:12:36,526 - AlexNetTest - INFO - Time: 13.040630 Step: 540 Avg Accuracy: 0.479508 Avg Top 5 Accuracy: 0.717306 737 | 2018-08-27 13:12:49,719 - AlexNetTest - INFO - Time: 13.192755 Step: 550 Avg Accuracy: 0.479441 Avg Top 5 Accuracy: 0.717134 738 | 2018-08-27 13:13:02,758 - AlexNetTest - INFO - Time: 13.039084 Step: 560 Avg Accuracy: 0.479668 Avg Top 5 Accuracy: 0.717455 739 | 2018-08-27 13:13:15,888 - AlexNetTest - INFO - Time: 13.129155 Step: 570 Avg Accuracy: 0.479778 Avg Top 5 Accuracy: 0.717573 740 | 2018-08-27 13:13:28,835 - AlexNetTest - INFO - Time: 12.946508 Step: 580 Avg Accuracy: 0.480018 Avg Top 5 Accuracy: 0.718051 741 | 2018-08-27 13:13:41,108 - AlexNetTest - INFO - Time: 12.272491 Step: 590 Avg Accuracy: 0.480436 Avg Top 5 Accuracy: 0.718168 742 | 2018-08-27 13:13:54,168 - AlexNetTest - INFO - Time: 13.059287 Step: 600 Avg Accuracy: 0.480384 Avg Top 5 Accuracy: 0.718282 743 | 2018-08-27 13:14:07,301 - AlexNetTest - INFO - Time: 13.132566 Step: 610 Avg Accuracy: 0.480398 Avg Top 5 Accuracy: 0.718507 744 | 2018-08-27 13:14:19,721 - AlexNetTest - INFO - Time: 12.419736 Step: 620 Avg Accuracy: 0.480072 Avg Top 5 Accuracy: 0.718373 745 | 2018-08-27 13:14:32,134 - AlexNetTest - INFO - Time: 12.413139 Step: 630 Avg Accuracy: 0.479782 Avg Top 5 Accuracy: 0.717883 746 | 2018-08-27 13:14:44,723 - AlexNetTest - INFO - Time: 12.588432 Step: 640 Avg Accuracy: 0.479890 Avg Top 5 Accuracy: 0.717909 747 | 2018-08-27 13:14:57,700 - AlexNetTest - INFO - Time: 12.977309 Step: 650 Avg Accuracy: 0.480031 Avg Top 5 Accuracy: 0.717730 748 | 2018-08-27 13:15:10,431 - AlexNetTest - INFO - Time: 12.730501 Step: 660 Avg Accuracy: 0.480049 Avg Top 5 Accuracy: 0.717639 749 | 2018-08-27 13:15:22,840 - AlexNetTest - INFO - Time: 12.408502 Step: 670 Avg Accuracy: 0.479660 Avg Top 5 Accuracy: 0.717306 750 | 2018-08-27 13:15:35,534 - AlexNetTest - INFO - Time: 12.692948 Step: 680 Avg Accuracy: 0.479798 Avg Top 5 Accuracy: 0.717213 751 | 2018-08-27 13:15:48,150 - AlexNetTest - INFO - Time: 12.615839 Step: 690 Avg Accuracy: 0.479807 Avg Top 5 Accuracy: 0.717201 752 | 2018-08-27 13:16:00,589 - AlexNetTest - INFO - Time: 12.438730 Step: 700 Avg Accuracy: 0.479839 Avg Top 5 Accuracy: 0.717401 753 | 2018-08-27 13:16:12,994 - AlexNetTest - INFO - Time: 12.404172 Step: 710 Avg Accuracy: 0.480013 Avg Top 5 Accuracy: 0.717300 754 | 2018-08-27 13:16:26,059 - AlexNetTest - INFO - Time: 13.064807 Step: 720 Avg Accuracy: 0.479987 Avg Top 5 Accuracy: 0.717352 755 | 2018-08-27 13:16:39,105 - AlexNetTest - INFO - Time: 13.045703 Step: 730 Avg Accuracy: 0.480346 Avg Top 5 Accuracy: 0.717671 756 | 2018-08-27 13:16:51,973 - AlexNetTest - INFO - Time: 12.867456 Step: 740 Avg Accuracy: 0.480284 Avg Top 5 Accuracy: 0.717400 757 | 2018-08-27 13:17:04,383 - AlexNetTest - INFO - Time: 12.410025 Step: 750 Avg Accuracy: 0.480183 Avg Top 5 Accuracy: 0.717439 758 | 2018-08-27 13:17:17,360 - AlexNetTest - INFO - Time: 12.976591 Step: 760 Avg Accuracy: 0.479796 Avg Top 5 Accuracy: 0.717282 759 | 2018-08-27 13:17:29,867 - AlexNetTest - INFO - Time: 12.506104 Step: 770 Avg Accuracy: 0.480008 Avg Top 5 Accuracy: 0.717433 760 | 2018-08-27 13:17:42,530 - AlexNetTest - INFO - Time: 12.662959 Step: 780 Avg Accuracy: 0.479974 Avg Top 5 Accuracy: 0.717450 761 | 2018-08-27 13:17:55,512 - AlexNetTest - INFO - Time: 12.981228 Step: 790 Avg Accuracy: 0.479851 Avg Top 5 Accuracy: 0.717535 762 | 2018-08-27 13:18:08,012 - AlexNetTest - INFO - Time: 12.499512 Step: 800 Avg Accuracy: 0.479674 Avg Top 5 Accuracy: 0.717862 763 | 2018-08-27 13:18:21,075 - AlexNetTest - INFO - Time: 13.063495 Step: 810 Avg Accuracy: 0.479356 Avg Top 5 Accuracy: 0.717864 764 | 2018-08-27 13:18:33,829 - AlexNetTest - INFO - Time: 12.752961 Step: 820 Avg Accuracy: 0.479570 Avg Top 5 Accuracy: 0.718008 765 | 2018-08-27 13:18:46,093 - AlexNetTest - INFO - Time: 12.263985 Step: 830 Avg Accuracy: 0.479637 Avg Top 5 Accuracy: 0.717951 766 | 2018-08-27 13:18:58,600 - AlexNetTest - INFO - Time: 12.506217 Step: 840 Avg Accuracy: 0.479684 Avg Top 5 Accuracy: 0.717802 767 | 2018-08-27 13:19:11,708 - AlexNetTest - INFO - Time: 13.107388 Step: 850 Avg Accuracy: 0.479739 Avg Top 5 Accuracy: 0.717924 768 | 2018-08-27 13:19:24,751 - AlexNetTest - INFO - Time: 13.042732 Step: 860 Avg Accuracy: 0.479902 Avg Top 5 Accuracy: 0.718133 769 | 2018-08-27 13:19:37,160 - AlexNetTest - INFO - Time: 12.408755 Step: 870 Avg Accuracy: 0.479836 Avg Top 5 Accuracy: 0.718230 770 | 2018-08-27 13:19:50,333 - AlexNetTest - INFO - Time: 13.171790 Step: 880 Avg Accuracy: 0.479870 Avg Top 5 Accuracy: 0.718475 771 | 2018-08-27 13:20:03,449 - AlexNetTest - INFO - Time: 13.116052 Step: 890 Avg Accuracy: 0.479658 Avg Top 5 Accuracy: 0.718478 772 | 2018-08-27 13:20:16,585 - AlexNetTest - INFO - Time: 13.135673 Step: 900 Avg Accuracy: 0.479675 Avg Top 5 Accuracy: 0.718568 773 | 2018-08-27 13:20:28,942 - AlexNetTest - INFO - Time: 12.356850 Step: 910 Avg Accuracy: 0.479624 Avg Top 5 Accuracy: 0.718621 774 | 2018-08-27 13:20:41,193 - AlexNetTest - INFO - Time: 12.250684 Step: 920 Avg Accuracy: 0.479769 Avg Top 5 Accuracy: 0.718835 775 | 2018-08-27 13:20:53,985 - AlexNetTest - INFO - Time: 12.791821 Step: 930 Avg Accuracy: 0.479734 Avg Top 5 Accuracy: 0.718817 776 | 2018-08-27 13:21:07,123 - AlexNetTest - INFO - Time: 13.136884 Step: 940 Avg Accuracy: 0.479659 Avg Top 5 Accuracy: 0.718551 777 | 2018-08-27 13:21:20,136 - AlexNetTest - INFO - Time: 13.013446 Step: 950 Avg Accuracy: 0.479495 Avg Top 5 Accuracy: 0.718372 778 | 2018-08-27 13:21:32,524 - AlexNetTest - INFO - Time: 12.387778 Step: 960 Avg Accuracy: 0.479448 Avg Top 5 Accuracy: 0.718392 779 | 2018-08-27 13:21:44,889 - AlexNetTest - INFO - Time: 12.364084 Step: 970 Avg Accuracy: 0.479515 Avg Top 5 Accuracy: 0.718299 780 | 2018-08-27 13:21:57,292 - AlexNetTest - INFO - Time: 12.403014 Step: 980 Avg Accuracy: 0.479613 Avg Top 5 Accuracy: 0.718487 781 | 2018-08-27 13:22:09,761 - AlexNetTest - INFO - Time: 12.468080 Step: 990 Avg Accuracy: 0.479724 Avg Top 5 Accuracy: 0.718513 782 | 2018-08-27 13:22:23,031 - AlexNetTest - INFO - Time: 13.269978 Step: 1000 Avg Accuracy: 0.479833 Avg Top 5 Accuracy: 0.718407 783 | 2018-08-27 13:22:35,935 - AlexNetTest - INFO - Time: 12.903443 Step: 1010 Avg Accuracy: 0.479677 Avg Top 5 Accuracy: 0.718340 784 | 2018-08-27 13:22:48,359 - AlexNetTest - INFO - Time: 12.423773 Step: 1020 Avg Accuracy: 0.479593 Avg Top 5 Accuracy: 0.718253 785 | 2018-08-27 13:23:01,438 - AlexNetTest - INFO - Time: 13.078756 Step: 1030 Avg Accuracy: 0.479540 Avg Top 5 Accuracy: 0.718394 786 | 2018-08-27 13:23:14,352 - AlexNetTest - INFO - Time: 12.913394 Step: 1040 Avg Accuracy: 0.479572 Avg Top 5 Accuracy: 0.718472 787 | 2018-08-27 13:23:26,728 - AlexNetTest - INFO - Time: 12.376060 Step: 1050 Avg Accuracy: 0.479677 Avg Top 5 Accuracy: 0.718468 788 | 2018-08-27 13:23:39,127 - AlexNetTest - INFO - Time: 12.398613 Step: 1060 Avg Accuracy: 0.479545 Avg Top 5 Accuracy: 0.718426 789 | 2018-08-27 13:23:51,669 - AlexNetTest - INFO - Time: 12.541065 Step: 1070 Avg Accuracy: 0.479356 Avg Top 5 Accuracy: 0.718145 790 | 2018-08-27 13:24:04,604 - AlexNetTest - INFO - Time: 12.935105 Step: 1080 Avg Accuracy: 0.479150 Avg Top 5 Accuracy: 0.718172 791 | 2018-08-27 13:24:17,059 - AlexNetTest - INFO - Time: 12.454449 Step: 1090 Avg Accuracy: 0.479549 Avg Top 5 Accuracy: 0.718549 792 | 2018-08-27 13:24:30,097 - AlexNetTest - INFO - Time: 13.037845 Step: 1100 Avg Accuracy: 0.479493 Avg Top 5 Accuracy: 0.718495 793 | 2018-08-27 13:24:42,575 - AlexNetTest - INFO - Time: 12.477384 Step: 1110 Avg Accuracy: 0.479403 Avg Top 5 Accuracy: 0.718349 794 | 2018-08-27 13:24:55,606 - AlexNetTest - INFO - Time: 13.030360 Step: 1120 Avg Accuracy: 0.479399 Avg Top 5 Accuracy: 0.718478 795 | 2018-08-27 13:25:08,003 - AlexNetTest - INFO - Time: 12.396415 Step: 1130 Avg Accuracy: 0.479250 Avg Top 5 Accuracy: 0.718501 796 | 2018-08-27 13:25:21,046 - AlexNetTest - INFO - Time: 13.043226 Step: 1140 Avg Accuracy: 0.479164 Avg Top 5 Accuracy: 0.718558 797 | 2018-08-27 13:25:33,641 - AlexNetTest - INFO - Time: 12.594561 Step: 1150 Avg Accuracy: 0.479311 Avg Top 5 Accuracy: 0.718662 798 | 2018-08-27 13:25:45,801 - AlexNetTest - INFO - Time: 12.160021 Step: 1160 Avg Accuracy: 0.479261 Avg Top 5 Accuracy: 0.718575 799 | 2018-08-27 13:25:58,596 - AlexNetTest - INFO - Time: 12.794882 Step: 1170 Avg Accuracy: 0.479445 Avg Top 5 Accuracy: 0.718783 800 | 2018-08-27 13:26:00,006 - AlexNetTest - INFO - Final - Avg Accuracy: 0.479513 Avg Top 5 Accuracy: 0.718840 801 | --------------------------------------------------------------------------------