nnunet/training/network_training/mynnUNetTrainerV2.py
def initialize(self, training=True, force_load_plans=False):
        '''
        Print keys to visdom and set number of epochs
        '''
        timestamp = datetime.now()
        if self.usevisdom and training:
            try:
                self.plotter = get_plotter(self.model_name)
                self.plotter.plot_text("Initialising this model: %s <br> on %d_%d_%d_%02.0d_%02.0d_%02.0d" %
                                        (self.model_name,timestamp.year, timestamp.month, timestamp.day, timestamp.hour, timestamp.minute,
                                        timestamp.second), plot_name="Welcome")
            except:
                print("Unable to connect to visdom.")

        #super().initialize(training, force_load_plans)
        ## ------- nnunettrainerv2 nodeepsupervision
        """
        removed deep supervision
        :return:
        """
        if not self.was_initialized:
            maybe_mkdir_p(self.output_folder)

            if force_load_plans or (self.plans is None):
                self.load_plans_file()

            self.process_plans(self.plans)

            self.setup_DA_params()

            self.folder_with_preprocessed_data = join(self.dataset_directory, self.plans['data_identifier'] +
                                                      "_stage%d" % self.stage)
            if training:
                self.dl_tr, self.dl_val = self.get_basic_generators()
                if self.unpack_data:
                    print("unpacking dataset")
                    unpack_dataset(self.folder_with_preprocessed_data)
                    print("done")
                else:
                    print(
                        "INFO: Not unpacking data! Training may be slow due to that. Pray you are not using 2d or you "
                        "will wait all winter for your model to finish!")

                assert self.deep_supervision_scales is None
                self.tr_gen, self.val_gen = get_moreDA_augmentation(self.dl_tr, self.dl_val,
                                                                    self.data_aug_params[
                                                                        'patch_size_for_spatialtransform'],
                                                                    self.data_aug_params,
                                                                    deep_supervision_scales=self.deep_supervision_scales,
                                                                    classes=None,
                                                                    pin_memory=self.pin_memory)

                self.print_to_log_file("TRAINING KEYS:\n %s" % (str(self.dataset_tr.keys())),
                                       also_print_to_console=False)
                self.print_to_log_file("VALIDATION KEYS:\n %s" % (str(self.dataset_val.keys())),
                                       also_print_to_console=False)
            else:
                pass

            self.initialize_network()
            self.initialize_optimizer_and_scheduler()

            assert isinstance(self.network, (SegmentationNetwork, nn.DataParallel))
        else:
            self.print_to_log_file('self.was_initialized is True, not running self.initialize again')
        self.was_initialized = True

        # -----------------------

        if self.freeze:
            self.initialize_optimizer_and_scheduler_freezing()

        if training and self.usevisdom:
            try:
                self.plotter.plot_text("EPOCHS: %s <br> LEARNING RATE: %s <br> TRAINING KEYS: %s <br> VALIDATION KEYS: %s" % (str(self.max_num_epochs),str(self.initial_lr),str(self.dataset_tr.keys()),str(self.dataset_val.keys())), plot_name="Dataset_Info")
            except:
                print("Unable to connect to visdom.")

        Print keys to visdom and set number of epochs
        
Print keys to visdom and set number of epochs
Print keys to visdom and set number of epochs
def initialize(self, training=True, force_load_plans=False):
        timestamp = datetime.now()
        if self.usevisdom and training:
            try:
                self.plotter = get_plotter(self.model_name)
                self.plotter.plot_text("Initialising this model: %s <br> on %d_%d_%d_%02.0d_%02.0d_%02.0d" %
                                        (self.model_name,timestamp.year, timestamp.month, timestamp.day, timestamp.hour, timestamp.minute,
                                        timestamp.second), plot_name="Welcome")
            except:
                print("Unable to connect to visdom.")
        if not self.was_initialized:
            maybe_mkdir_p(self.output_folder)
            if force_load_plans or (self.plans is None):
                self.load_plans_file()
            self.process_plans(self.plans)
            self.setup_DA_params()
            self.folder_with_preprocessed_data = join(self.dataset_directory, self.plans['data_identifier'] +
                                                      "_stage%d" % self.stage)
            if training:
                self.dl_tr, self.dl_val = self.get_basic_generators()
                if self.unpack_data:
                    print("unpacking dataset")
                    unpack_dataset(self.folder_with_preprocessed_data)
                    print("done")
                else:
                    print(
                        "INFO: Not unpacking data! Training may be slow due to that. Pray you are not using 2d or you "
                        "will wait all winter for your model to finish!")
                assert self.deep_supervision_scales is None
                self.tr_gen, self.val_gen = get_moreDA_augmentation(self.dl_tr, self.dl_val,
                                                                    self.data_aug_params[
                                                                        'patch_size_for_spatialtransform'],
                                                                    self.data_aug_params,
                                                                    deep_supervision_scales=self.deep_supervision_scales,
                                                                    classes=None,
                                                                    pin_memory=self.pin_memory)
                self.print_to_log_file("TRAINING KEYS:\n %s" % (str(self.dataset_tr.keys())),
                                       also_print_to_console=False)
                self.print_to_log_file("VALIDATION KEYS:\n %s" % (str(self.dataset_val.keys())),
                                       also_print_to_console=False)
            else:
                pass
            self.initialize_network()
            self.initialize_optimizer_and_scheduler()
            assert isinstance(self.network, (SegmentationNetwork, nn.DataParallel))
        else:
            self.print_to_log_file('self.was_initialized is True, not running self.initialize again')
        self.was_initialized = True
        if self.freeze:
            self.initialize_optimizer_and_scheduler_freezing()
        if training and self.usevisdom:
            try:
                self.plotter.plot_text("EPOCHS: %s <br> LEARNING RATE: %s <br> TRAINING KEYS: %s <br> VALIDATION KEYS: %s" % (str(self.max_num_epochs),str(self.initial_lr),str(self.dataset_tr.keys()),str(self.dataset_val.keys())), plot_name="Dataset_Info")
            except:
                print("Unable to connect to visdom.")
def initialize ( self , training = True , force_load_plans = False ) : timestamp = datetime . now ( ) if self . usevisdom and training : try : self . plotter = get_plotter ( self . model_name ) self . plotter . plot_text ( "Initialising this model: %s <br> on %d_%d_%d_%02.0d_%02.0d_%02.0d" % ( self . model_name , timestamp . year , timestamp . month , timestamp . day , timestamp . hour , timestamp . minute , timestamp . second ) , plot_name = "Welcome" ) except : print ( "Unable to connect to visdom." ) """
        removed deep supervision
        :return:
        """ if not self . was_initialized : maybe_mkdir_p ( self . output_folder ) if force_load_plans or ( self . plans is None ) : self . load_plans_file ( ) self . process_plans ( self . plans ) self . setup_DA_params ( ) self . folder_with_preprocessed_data = join ( self . dataset_directory , self . plans [ 'data_identifier' ] + "_stage%d" % self . stage ) if training : self . dl_tr , self . dl_val = self . get_basic_generators ( ) if self . unpack_data : print ( "unpacking dataset" ) unpack_dataset ( self . folder_with_preprocessed_data ) print ( "done" ) else : print ( "INFO: Not unpacking data! Training may be slow due to that. Pray you are not using 2d or you " "will wait all winter for your model to finish!" ) assert self . deep_supervision_scales is None self . tr_gen , self . val_gen = get_moreDA_augmentation ( self . dl_tr , self . dl_val , self . data_aug_params [ 'patch_size_for_spatialtransform' ] , self . data_aug_params , deep_supervision_scales = self . deep_supervision_scales , classes = None , pin_memory = self . pin_memory ) self . print_to_log_file ( "TRAINING KEYS:\n %s" % ( str ( self . dataset_tr . keys ( ) ) ) , also_print_to_console = False ) self . print_to_log_file ( "VALIDATION KEYS:\n %s" % ( str ( self . dataset_val . keys ( ) ) ) , also_print_to_console = False ) else : pass self . initialize_network ( ) self . initialize_optimizer_and_scheduler ( ) assert isinstance ( self . network , ( SegmentationNetwork , nn . DataParallel ) ) else : self . print_to_log_file ( 'self.was_initialized is True, not running self.initialize again' ) self . was_initialized = True if self . freeze : self . initialize_optimizer_and_scheduler_freezing ( ) if training and self . usevisdom : try : self . plotter . plot_text ( "EPOCHS: %s <br> LEARNING RATE: %s <br> TRAINING KEYS: %s <br> VALIDATION KEYS: %s" % ( str ( self . max_num_epochs ) , str ( self . initial_lr ) , str ( self . dataset_tr . keys ( ) ) , str ( self . dataset_val . keys ( ) ) ) , plot_name = "Dataset_Info" ) except : print ( "Unable to connect to visdom." )
Print keys to visdom and set number of epochs
Print keys to visdom and set number of epochs
'''
        Print keys to visdom and set number of epochs
        ''' #super().initialize(training, force_load_plans) ## ------- nnunettrainerv2 nodeepsupervision """
        removed deep supervision
        :return:
        """ # -----------------------
self
training
force_load_plans