from networks import resnet_cifar branchyNet = resnet_cifar.get_network(n_class=100, n_layer=5) # branchyNet.print_models() # ren + print '0. Define Network' branchyNet.to_gpu() branchyNet.training() # Import Data # from datasets import pcifar10 # original # x_train, y_train, _, _ = pcifar10.get_data() # original from _tool import chainerDataset x_train, y_train, _, _ = chainerDataset.get_chainer_cifar100() print '1. Import Data' # Settings TRAIN_BATCHSIZE = 32 # 64 # TEST_BATCHSIZE = 64 # 1 # ren - TRAIN_NUM_EPOCHS = 100 branchyNet.verbose = False # ren + branchyNet.gpu = True # ren + # Train Main Network print '2. Train Main Network'
# Load Network import dill with open("_models/train_resnet32_cifar100_gpu_(network).bn", "r") as f: branchyNet = dill.load(f) # branchyNet.print_models() # ren + print '0. Load Network' # Import Data # from datasets import pcifar10 # original # _, _, x_test, y_test = pcifar10.get_data() # original from _tool import chainerDataset _, _, x_test, y_test = chainerDataset.get_chainer_cifar100() print '1. Import Data' # Settings TEST_BATCHSIZE = 1 print '2. set network to inference mode' branchyNet.to_gpu() branchyNet.testing() branchyNet.verbose = False branchyNet.gpu = True # ren + # Test main