def read_attributes(path): print("Reading execution attributes from ", path) attr = ExecutionAttribute() lines = [line.rstrip('\n') for line in open(path)] attr.seq = int(lines[0].split("=", 1)[1]) attr.img_width = int(lines[1].split("=", 1)[1]) attr.img_height = int(lines[2].split("=", 1)[1]) attr.path = lines[3].split("=", 1)[1] attr.summ_basename = lines[4].split("=", 1)[1] attr.epochs = int(lines[5].split("=", 1)[1]) attr.batch_size = int(lines[6].split("=", 1)[1]) attr.train_data_dir = lines[7].split("=", 1)[1] attr.validation_data_dir = lines[8].split("=", 1)[1] attr.test_data_dir = lines[9].split("=", 1)[1] attr.steps_train = int(lines[10].split("=", 1)[1]) attr.steps_valid = int(lines[11].split("=", 1)[1]) attr.steps_test = int(lines[12].split("=", 1)[1]) attr.architecture = lines[13].split("=", 1)[1] attr.curr_basename = lines[14].split("=", 1)[1] return attr
attr.architecture = 'vgg19' attr.csv_path = 'csv/clinical_data.csv' attr.s3_path = NETWORK_FORMAT + '/' + IMAGE_FORMAT attr.numpy_path = '/mnt/data/image/2d/numpy/' + IMG_TYPE # attr.numpy_path = '/home/amenegotto/dataset/2d/numpy/' + IMG_TYPE attr.path = '/mnt/data/image/2d/' + IMG_TYPE results_path = create_results_dir(SUMMARY_BASEPATH, 'fine-tuning', attr.architecture) attr.summ_basename = get_base_name(results_path) attr.set_dir_names() attr.batch_size = 128 attr.epochs = 500 attr.img_width = 224 attr.img_height = 224 input_attributes_s = (20, ) # how many times to execute the training/validation/test cycle CYCLES = 1 for i in range(0, CYCLES): #Load the VGG model vgg_conv = VGG19(weights='imagenet', include_top=False, input_shape=(attr.img_width, attr.img_height, 3)) # Freeze the layers except the last 4 layers for layer in vgg_conv.layers[:-4]: