def __init__(self, **kwargs):
        super().__init__(**kwargs)

        torch.set_num_threads(int(os.environ.get("OMP_NUM_THREADS", 1)))
        torch.backends.cudnn.benchmark = True

        self.avg_loss = AvgMeter(50)
        self.dtype = kwargs.get("dtype", None)  # just for test for now
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        hvd.init()
        torch.set_num_threads(int(os.environ.get("OMP_NUM_THREADS", 1)))
        torch.cuda.set_device(hvd.local_rank())
        torch.backends.cudnn.benchmark = True

        self.avg_loss = AvgMeter(50)
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        torch.set_num_threads(int(os.environ.get("OMP_NUM_THREADS", 1)))
        torch.backends.cudnn.benchmark = True

        self.avg_loss = AvgMeter(50)
        self.dtype = kwargs.get("dtype", None)  # just for test for now
        self.model_name_temp = get_model_name()
        print("Models and tensorboard events files are saved to:\n  ", self.model_name_temp)
Beispiel #4
0
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        # torch.set_num_threads(int(os.environ.get("OMP_NUM_THREADS", 1)))
        if torch.cuda.is_available():
            torch.cuda.set_device("cuda:0")
        else:
            torch.cuda.set_device("cpu")
        torch.backends.cudnn.benchmark = True

        self.avg_loss = AvgMeter(50)
        self.dtype = kwargs.get("dtype", None)  # just for test for now

        self.writer = SummaryWriter()