@@ -40,7 +40,7 @@ def add_path(path):
4040def argparser ():
4141 parser = argparse .ArgumentParser (description = 'Passive Learning - Image Classification' )
4242 parser .add_argument ('--cfg' , dest = 'cfg_file' , help = 'Config file' , required = True , type = str )
43-
43+ parser . add_argument ( '--exp-name' , dest = 'exp_name' , help = 'Experiment Name' , required = True , type = str )
4444 return parser
4545
4646def plot_arrays (x_vals , y_vals , x_name , y_name , dataset_name , out_dir , isDebug = False ):
@@ -97,6 +97,10 @@ def main(cfg):
9797 device = torch .device ("cuda" if use_cuda else "cpu" )
9898 kwargs = {'num_workers' : cfg .DATA_LOADER .NUM_WORKERS , 'pin_memory' : cfg .DATA_LOADER .PIN_MEMORY } if use_cuda else {}
9999
100+ # Auto assign a RNG_SEED when not supplied a value
101+ if cfg .RNG_SEED is None :
102+ cfg .RNG_SEED = np .random .randint (100 )
103+
100104 # Using specific GPU
101105 # os.environ['CUDA_VISIBLE_DEVICES'] = str(cfg.GPU_ID)
102106 # print("Using GPU : {}.\n".format(cfg.GPU_ID))
@@ -452,4 +456,5 @@ def test_epoch(test_loader, model, test_meter, cur_epoch):
452456
453457if __name__ == "__main__" :
454458 cfg .merge_from_file (argparser ().parse_args ().cfg_file )
459+ cfg .EXP_NAME = argparser ().parse_args ().exp_name
455460 main (cfg )
0 commit comments