Beispiel #1
0
def _main():
    base_dir = os.path.dirname(__file__)
    request = {
        "dataset":
        "imagenet",
        "model_name":
        "resnet_50",
        "data_dir":
        os.path.join(base_dir, "./data/imagenet"),
        "batch_size":
        256,
        "batch_size_val":
        100,
        "learning_rate":
        0.1,
        "epochs":
        120,
        "checkpoint_path":
        os.path.join(base_dir, "./models_ckpt/resnet_50_imagenet_pruned"),
        "checkpoint_save_period":
        5,  # save a checkpoint every 5 epoch
        "checkpoint_eval_path":
        os.path.join(base_dir, "./models_eval_ckpt/resnet_50_imagenet_pruned"),
        "scheduler":
        "uniform_auto",
        "scheduler_file_name":
        "resnet_50_imagenet_bn.yaml"
    }
    prune_model(request)
def _main():
    base_dir = os.path.dirname(__file__)
    request = {
        "dataset":
        "cifar10",
        "model_name":
        "vgg_m_16",
        "data_dir":
        os.path.join(base_dir, "./data/cifar10"),
        "batch_size":
        128,
        "batch_size_val":
        100,
        "learning_rate":
        0.1,
        "epochs":
        160,
        "checkpoint_path":
        os.path.join(base_dir, "./models_ckpt/vgg_m_16_cifar10"),
        "checkpoint_save_period":
        20,  # save a checkpoint every epoch
        "checkpoint_eval_path":
        os.path.join(base_dir, "./models_eval_ckpt/vgg_m_16_cifar10"),
        "scheduler":
        "train"
    }
    prune_model(request)
def _main():
    base_dir = os.path.dirname(__file__)
    request = {
        "dataset":
        "imagenet",
        "model_name":
        "mobilenet_v2",
        "data_dir":
        os.path.join(base_dir, "./data/imagenet"),
        "batch_size":
        256,
        "batch_size_val":
        100,
        "learning_rate":
        0.05,
        "epochs":
        240,
        "checkpoint_path":
        os.path.join(base_dir, "./models_ckpt/mobilenet_v2_imagenet"),
        "checkpoint_save_period":
        5,  # save a checkpoint every 5 epoch
        "checkpoint_eval_path":
        os.path.join(base_dir, "./models_eval_ckpt/mobilenet_v2_imagenet"),
        "scheduler":
        "train"
    }
    prune_model(request)
Beispiel #4
0
def _main():
    base_dir = os.path.dirname(__file__)
    request = {
        "dataset":
        "imagenet",
        "model_name":
        "resnet_50",
        "data_dir":
        os.path.join(base_dir, "/data/imagenet/tfrecord-dataset"),
        "batch_size":
        256,
        "batch_size_val":
        100,
        "learning_rate":
        0.1,
        "epochs":
        360,
        "checkpoint_path":
        os.path.join(base_dir, "./models_ckpt/resnet_50_imagenet_pruned"),
        "checkpoint_save_period":
        5,  # save a checkpoint every 5 epoch
        "checkpoint_eval_path":
        os.path.join(base_dir, "./models_eval_ckpt/resnet_50_imagenet_pruned"),
        "scheduler":
        "uniform_auto",
        "is_distill":
        True,
        "scheduler_file_name":
        "resnet_50_imagenet_0.5_distill.yaml"
    }
    os.environ['L2_WEIGHT_DECAY'] = "5e-5"
    prune_model(request)
def _main():
    base_dir = os.path.dirname(__file__)
    request = {
        "dataset":
        "mnist",
        "model_name":
        "lenet",
        "data_dir":
        os.path.join(base_dir, "./data/mnist"),
        "batch_size":
        120,
        "batch_size_val":
        100,
        "learning_rate":
        0.001,
        "epochs":
        12,
        "checkpoint_path":
        os.path.join(base_dir, "./models_ckpt/lenet_mnist_pruned"),
        "checkpoint_save_period":
        1,  # save a checkpoint every n epoch
        "checkpoint_eval_path":
        os.path.join(base_dir, "./models_eval_ckpt/lenet_mnist_pruned"),
        "scheduler":
        "uniform_auto"
    }
    prune_model(request)