Best Python code snippet using locust
parsers1.py
Source:parsers1.py
...32 return vae33def train_parser():34 parser = argparse.ArgumentParser()35 ### Architecture Parameters36 parser.add_argument('--model', choices=['transvae', 'rnnattn', 'rnn'],37 required=True, type=str)38 parser.add_argument('--d_model', default=128, type=int)39 parser.add_argument('--d_feedforward', default=128, type=int)40 parser.add_argument('--d_latent', default=128, type=int)41 parser.add_argument('--property_predictor', default=False, action='store_true')42 parser.add_argument('--d_property_predictor', default=256, type=int)43 parser.add_argument('--depth_property_predictor', default=2, type=int)44 ### Hyperparameters45 parser.add_argument('--batch_size', default=500, type=int)46 parser.add_argument('--batch_chunks', default=5, type=int)47 parser.add_argument('--beta', default=0.05, type=float)48 parser.add_argument('--beta_init', default=1e-8, type=float)49 parser.add_argument('--anneal_start', default=0, type=int)50 parser.add_argument('--adam_lr', default=3e-4, type=float)51 parser.add_argument('--lr_scale', default=1, type=float)52 parser.add_argument('--warmup_steps', default=10000, type=int)53 parser.add_argument('--eps_scale', default=1, type=float)54 parser.add_argument('--epochs', default=100, type=int)55 #parser.add_argument('--end_beta_scale', default=20, type=int)56 ### Data Parameters57 parser.add_argument('--data_source', choices=['zinc', 'pubchem', 'custom'],58 required=True, type=str)59 parser.add_argument('--train_mols_path', default=None, type=str)60 parser.add_argument('--test_mols_path', default=None, type=str)61 parser.add_argument('--train_props_path', default=None, type=str)62 parser.add_argument('--test_props_path', default=None, type=str)63 parser.add_argument('--vocab_path', default=None, type=str)64 parser.add_argument('--char_weights_path', default=None, type=str)65 ### Load Parameters66 parser.add_argument('--checkpoint', default=None, type=str)67 ### Save Parameters68 parser.add_argument('--save_name', default=None, type=str)69 parser.add_argument('--save_freq', default=5, type=int)70 ### Adjacency Matrix Parameters71 parser.add_argument('--adj_matrix', default=False, action='store_true')72 parser.add_argument('--adj_weight', default=0.3, type=float)73 ### MMD Parameter74 parser.add_argument('--mmd_use', default=False, action='store_true')75 return parser76def sample_parser():77 parser = argparse.ArgumentParser()78 ### Number of workers79 parser.add_argument('--cores', default=10, type=int)80 ### Load Files81 parser.add_argument('--model', choices=['transvae', 'rnnattn', 'rnn'],82 required=True, type=str)83 parser.add_argument('--model_ckpt', required=True, type=str)84 parser.add_argument('--mols', default=None, type=str)85 ### Sampling Parameters86 parser.add_argument('--sample_mode', choices=['rand', 'high_entropy', 'k_high_entropy'],87 required=True, type=str)88 parser.add_argument('--k', default=15, type=int)89 parser.add_argument('--condition', default='', type=str)90 parser.add_argument('--entropy_cutoff', default=5, type=float)91 parser.add_argument('--n_samples', default=30000, type=int)92 parser.add_argument('--n_samples_per_batch', default=1000, type=int)93 ### Save Parameters94 parser.add_argument('--save_path', default=None, type=str)95 ### for cbas pipeline only 96 parser.add_argument('--iteration', type=int, default=0)97 parser.add_argument('--name', type=str, default='CbAS_vae') # the query model name98 return parser99def attn_parser():100 parser = argparse.ArgumentParser()101 ### Load Files102 parser.add_argument('--model', choices=['transvae', 'rnnattn'],103 required=True, type=str)104 parser.add_argument('--model_ckpt', required=True, type=str)105 parser.add_argument('--mols', required=True, type=str)106 ### Sampling Parameters107 parser.add_argument('--n_samples', default=5000, type=int)108 parser.add_argument('--batch_size', default=500, type=int)109 parser.add_argument('--batch_chunks', default=5, type=int)110 parser.add_argument('--shuffle', default=False, action='store_true')111 ### Save Parameters112 parser.add_argument('--save_path', default=None, type=str)113 return parser114def docker_parser():115 parser = argparse.ArgumentParser()116 parser.add_argument("-s", "--server", default='etienne-reboul', help="Server to run the docking on, for path and configs.")117 parser.add_argument("-ex", "--exhaustiveness", default=64, help="exhaustiveness parameter for smina")118 parser.add_argument('--name', type=str, default='CbAS_vae') # the query model name119 parser.add_argument('--cores', type=int, default=10) 120 parser.add_argument('--oracle', type=str, default='smina') # 'qed' or 'docking' or 'qsar'121 parser.add_argument('--target', type=str, default='drd3')122 123 return parser124def cbas_trainer_parser():125 parser = argparse.ArgumentParser()126 parser.add_argument('--iteration', type=int, default=0)127 parser.add_argument('--name', type=str, default='CbAS_vae') # the experiment name128 parser.add_argument('--quantile', type=float, default=0.5) # quantile of scores accepted129 return parser130def slurm_master_parser():131 parser = argparse.ArgumentParser()132 ### main parameters 133 parser.add_argument('--prior_path', type=str, default='checkpoints/025_test.ckpt') # the prior VAE (pretrained)134 parser.add_argument('-n', '--name', type=str, default='CbAS_vae') # the name of the experiment135 parser.add_argument('--iters', type=int, default=2) # Number of iterations136 parser.add_argument('--model', choices=['transvae', 'rnnattn', 'rnn'], default='rnnattn', type=str)137 parser.add_argument('--main_cores', type=int, default=10) # Number of cores that should be used for Sampler and Docker138 parser.add_argument('--oracle', type=str, choices=['smina','RLDOCK'],default='smina') # 'qed' or 'docking' or 'qsar'139 parser.add_argument('--cur_iter', type=int, default=0) #current iteration140 ### SAMPLER141 parser.add_argument('--n_samples', type=int, default=30000) # Nbr of samples at each iter142 parser.add_argument('--sample_mode', choices=['rand', 'high_entropy', 'k_high_entropy'],143 default='rand', type=str)144 145 ### DOCKER146 parser.add_argument('--server', type=str, default='cedar', help='server to run on')147 parser.add_argument('--target', type=str, default='drd3', help='target to dock')148 parser.add_argument("-ex", "--exhaustiveness", default=64, help="exhaustiveness parameter for smina")149 parser.add_argument('--docker_cores', type=int, default=1)150 ### TRAINER151 parser.add_argument('--alphabet_path', type=str, default='data/moses_char_dict.pkl') # the alphabet used152 parser.add_argument('--weights_path', type=str, default='data/moses_char_weights.npy') # the alphabet used153 parser.add_argument('--quantile', type=float, default=0.5) # quantile of scores accepted154 155 return parser156def vocab_parser():157 parser = argparse.ArgumentParser()158 ### Vocab Parameters159 parser.add_argument('--mols', required=True, type=str)160 parser.add_argument('--freq_penalty', default=0.5, type=float)161 parser.add_argument('--pad_penalty', default=0.1, type=float)162 parser.add_argument('--vocab_name', default='custom_char_dict', type=str)163 parser.add_argument('--weights_name', default='custom_char_weights', type=str)164 parser.add_argument('--save_dir', default='data', type=str)...
option.py
Source:option.py
1import argparse2import template3parser = argparse.ArgumentParser(description='EDSR and MDSR')4parser.add_argument('--debug', action='store_true',5 help='Enables debug mode')6parser.add_argument('--template', default='.',7 help='You can set various templates in option.py')8# Hardware specifications9parser.add_argument('--n_threads', type=int, default=6,10 help='number of threads for data loading')11parser.add_argument('--cpu', action='store_true',12 help='use cpu only')13parser.add_argument('--n_GPUs', type=int, default=1,14 help='number of GPUs')15parser.add_argument('--seed', type=int, default=1,16 help='random seed')17# Data specifications18parser.add_argument('--dir_data', type=str, default='D:/xImageDataset/',19 help='dataset directory')20parser.add_argument('--dir_demo', type=str, default='../test',21 help='demo image directory')22parser.add_argument('--data_train', type=str, default='DIV2K',23 help='train dataset name')24parser.add_argument('--data_test', type=str, default='faces_test',25 help='test dataset name')26parser.add_argument('--data_range', type=str, default='1-800/801-810',27 help='train/test data range')28parser.add_argument('--ext', type=str, default='sep',29 help='dataset file extension')30parser.add_argument('--scale', type=str, default='4',31 help='super resolution scale')32parser.add_argument('--patch_size', type=int, default=256,33 help='output patch size')34parser.add_argument('--rgb_range', type=int, default=255,35 help='maximum value of RGB')36parser.add_argument('--n_colors', type=int, default=3,37 help='number of color channels to use')38parser.add_argument('--chop', action='store_true',39 help='enable memory-efficient forward')40parser.add_argument('--no_augment', action='store_true',41 help='do not use data augmentation')42# For FlatCam Argument43parser.add_argument('--sigma', type=int, default= 10,44 help='Noise level for simulation')45parser.add_argument('--is_fcSim', type=bool, default= True,46 help='Whether the measurement is simulated')47# Model specifications48parser.add_argument('--model', default='kcsres',49 help='model name')50parser.add_argument('--mid_channels', type=int, default=4,51 help='Intermediate channel features, exept kcsOrg')52#parser.add_argument('--out_channels', type=int, default=3,53# help='Intermediate channel features, exept kcsOrg')54parser.add_argument('--is_act', action='store_true',55 help='Intermediate channel features')56parser.add_argument('--act', type=str, default='relu',57 help='activation function')58parser.add_argument('--pre_train', type=str, default='',59 help='pre-trained model directory')60parser.add_argument('--extend', type=str, default='.',61 help='pre-trained model directory')62parser.add_argument('--n_resblocks', type=int, default=17,63 help='number of residual blocks')64parser.add_argument('--n_feats', type=int, default=64,65 help='number of feature maps')66parser.add_argument('--dilation', action='store_true',67 help='use dilated convolution')68parser.add_argument('--precision', type=str, default='single',69 choices=('single', 'half'),70 help='FP precision for test (single | half)')71# Training specifications72parser.add_argument('--reset', action='store_true',73 help='reset the training')74parser.add_argument('--test_every', type=int, default=1000,75 help='do test per every N batches')76parser.add_argument('--epochs', type=int, default=200,77 help='number of epochs to train')78parser.add_argument('--batch_size', type=int, default=16,79 help='input batch size for training')80parser.add_argument('--split_batch', type=int, default=1,81 help='split the batch into smaller chunks')82parser.add_argument('--self_ensemble', action='store_true',83 help='use self-ensemble method for test')84parser.add_argument('--test_only', action='store_true',85 help='set this option to test the model')86parser.add_argument('--gan_k', type=int, default=1,87 help='k value for adversarial loss')88# Optimization specifications89parser.add_argument('--lr', type=float, default=5e-4,90 help='learning rate')91parser.add_argument('--decay', type=str, default='50',92 help='learning rate decay type')93parser.add_argument('--gamma', type=float, default=0.5,94 help='learning rate decay factor for step decay')95parser.add_argument('--optimizer', default='ADAM',96 choices=('SGD', 'ADAM', 'RMSprop'),97 help='optimizer to use (SGD | ADAM | RMSprop)')98parser.add_argument('--momentum', type=float, default=0.9,99 help='SGD momentum')100parser.add_argument('--betas', type=tuple, default=(0.9, 0.999),101 help='ADAM beta')102parser.add_argument('--epsilon', type=float, default=1e-8,103 help='ADAM epsilon for numerical stability')104parser.add_argument('--weight_decay', type=float, default=0,105 help='weight decay')106parser.add_argument('--gclip', type=float, default=0,107 help='gradient clipping threshold (0 = no clipping)')108# Loss specifications109parser.add_argument('--loss', type=str, default='1*MSE',110 help='loss function configuration')111parser.add_argument('--skip_threshold', type=float, default='1e8',112 help='skipping batch that has large error')113# Log specifications114parser.add_argument('--save', type=str, default='test',115 help='file name to save')116parser.add_argument('--load', type=str, default='',117 help='file name to load')118parser.add_argument('--resume', type=int, default=0,119 help='resume from specific checkpoint')120parser.add_argument('--save_models', action='store_true',121 help='save all intermediate models')122parser.add_argument('--print_every', type=int, default=100,123 help='how many batches to wait before logging training status')124parser.add_argument('--save_results', action='store_true',125 help='save output results')126parser.add_argument('--save_gt', action='store_true',127 help='save low-resolution and high-resolution images together')128args = parser.parse_args()129template.set_template(args)130args.save = args.model + '_mid' + str(args.mid_channels) + '_sb' + str(args.batch_size) +'_sig' + str(args.sigma)131if args.is_act :132 args.save = args.save + '_PreLU'133else: 134 args.save = args.save + '_Linear'135note = ''136for loss in args.loss.split('+'):137 weight, loss_type = loss.split('*')138 note = note + '_' + str(weight) + loss_type139args.save = args.save + note 140args.scale = list(map(lambda x: int(x), args.scale.split('+')))...
config.py
Source:config.py
...7import torch8device = 'cuda' if torch.cuda.is_available() else 'cpu'9parser = argparse.ArgumentParser()10# frequently used parameters11parser.add_argument('--capacity', default=200000, type=int) # replay buffer size12parser.add_argument('--start_train', default=15000, type=int) # replay buffer size13parser.add_argument('--add_buffer', default=True, type=int) # replay buffer size14parser.add_argument('--learning_rate', default=0.000003, type=float)15parser.add_argument('--noise_level', default=0.5, type=float)16parser.add_argument('--noise_training_level', default=0.15, type=float)17parser.add_argument('--batch_size', default=36, type=int) # mini batch size18parser.add_argument('--test_id', default=222, type=int) # 1000+ means debug19parser.add_argument('--project_root', default='/scr1/system/gamma-robot/', type=str) # project root path20# parser.add_argument('--project_root', default='/juno/u/qiangzhang/system/gamma-robot/', type=str) # project root path21# reinforcement learning part hyper parameters22parser.add_argument('--mode', default='test', type=str) # mode = 'train' or 'test'23parser.add_argument("--env_name", default="Pendulum-v0") # OpenAI gym environment nameï¼ BipedalWalker-v224parser.add_argument('--tau', default=0.005, type=float) # target smoothing coefficient25parser.add_argument('--target_update_interval', default=1, type=int)26parser.add_argument('--iteration', default=5, type=int)27parser.add_argument('--update_time', default=10, type=int)28parser.add_argument('--gamma', default=0.99, type=int) # discounted factor29parser.add_argument('--num_iteration', default=100000, type=int) # num of games30parser.add_argument('--seed', default=1, type=int)31# optional parameters32parser.add_argument('--num_hidden_layers', default=2, type=int)33parser.add_argument('--sample_frequency', default=256, type=int)34parser.add_argument('--activation', default='Relu', type=str)35parser.add_argument('--render', default=False, type=bool) # show UI or not36parser.add_argument('--log_interval', default=200, type=int) #37parser.add_argument('--load', default=True, type=bool) # load model38parser.add_argument('--render_interval', default=100, type=int) # after render_interval, the env.render() will work39parser.add_argument('--policy_noise', default=0.001, type=float)40parser.add_argument('--noise_clip', default=0.03, type=float)41parser.add_argument('--policy_delay', default=2, type=int)42parser.add_argument('--exploration_noise', default=0.001, type=float)43parser.add_argument('--max_episode', default=2003, type=int)44parser.add_argument('--print_log', default=5, type=int)45parser.add_argument('--align_sample', default=False, type=int)46parser.add_argument('--more_embedding', default=True, type=int)47# environment part hyper parameters48parser.add_argument('--gui', default=True, type=int) #49parser.add_argument('--video_id', default=6, type=int) #50parser.add_argument('--object_id', default='nut', type=str) #51parser.add_argument('--observation', default='before_cnn', type=str) #joint_pose or end_pos or before_cnn or others52parser.add_argument('--view_point', default='first', type=str) # first or third53parser.add_argument('--rand_start', default='fixed', type=str) # rand or two or others54parser.add_argument('--rand_box', default='fixed', type=str) # rand or two or others55parser.add_argument('--axis_limit_x', default='[0.04,0.6]', type=str) #56parser.add_argument('--axis_limit_y', default='[-0.40,0.25]', type=str) #57parser.add_argument('--axis_limit_z', default='[0.26,0.7]', type=str) #58parser.add_argument('--img_w', default=320, type=int) #59parser.add_argument('--img_h', default=240, type=int) #60parser.add_argument('--obj_away_loss', default=True, type=int) #61parser.add_argument('--away_reward', default=0, type=float) #62parser.add_argument('--reward_diff', default=True, type=int) #63parser.add_argument('--out_reward', default=-10, type=float) #64parser.add_argument('--end_distance', default=0.20, type=float) #65parser.add_argument('--each_action_lim', default=0.03, type=float) #66parser.add_argument('--add_gripper', default=True, type=int) #67parser.add_argument('--add_motion', default=True, type=int) #68parser.add_argument('--write_img', default=1, type=int) #69parser.add_argument('--start_write', default=20000, type=int) #70# video prediction part hyper parameters71parser.add_argument('--action_id', default=8888, type=int) #72parser.add_argument('--cut_frame_num', default=20, type=int) #73parser.add_argument('--give_reward_num', default=1, type=int) #74parser.add_argument('--video_reward', default=True, type=int) #75parser.add_argument('--load_video_pred', default=None, type=object) #76parser.add_argument('--add_mask', default=True, type=int) #77parser.add_argument('--prob_softmax', default=False, type=int) #78parser.add_argument('--merge_class', default=True, type=int) #79parser.add_argument('--use_trn', default=False, type=int) #80parser.add_argument('--use_refine_baseline', default=False, type=int) #81parser.add_argument('--mean_norm', default=True, type=int) #82parser.add_argument('--fine_tune', default=True, type=int) #83parser.add_argument('--fine_tune_list', default=[86,87,93,94], type=int) #84# parser.add_argument('--fine_tune_list', default=[8,9,10,11,12], type=int) #85# parser.add_argument('--fine_tune_list', default=[12], type=int) #86# environment action using DMP part hyperparameters87parser.add_argument('--use_dmp', default=True, type=int) #88parser.add_argument('--load_dmp', default=None, type=object) #89parser.add_argument('--dmp_ratio', default=0.5, type=float) #90parser.add_argument('--dmp_num', default=40, type=float) #91parser.add_argument('--dmp_imitation', default=False, type=int) #92parser.add_argument('--actions_root', default='/scr1/system/beta-robot/dataset/actions', type=str) #93# environment action using embedding module hyperparameters94parser.add_argument('--use_embedding', default=True, type=int) #95parser.add_argument('--nlp_embedding', default=True, type=int) #96# parser.add_argument('--embedding_list', default=[8,9,10,11,12], type=int) #97# parser.add_argument('--embedding_list', default=[12,16,86,94,43,45], type=int) #98parser.add_argument('--embedding_list', default=[86,94,43,45], type=int) #99parser.add_argument('--load_embedding', default=None, type=object) #100parser.add_argument('--embedding_dim', default=4, type=int) #101parser.add_argument('--rl_embedding_dim', default=32, type=int) #102# parser.add_argument('--embedding_adjust', default=True, type=int) #103# environment action using cycle module hyperparameters104parser.add_argument('--use_cycle', default=False, type=int) #105parser.add_argument('--load_cycle', default=None, type=object) #106# environment action using A3C hyperparameters107parser.add_argument('--use_a3c', default=False, type=int) #108parser.add_argument('--process_N', default=1, type=int) #109parser.add_argument('--cuda_id', default=1, type=int) #110opt = parser.parse_args()111all_task_list = [8,9,10,11,12]112all_task_list.extend([16,17,18,19,20])113all_task_list.extend([40,41,42,43,44,45])114all_task_list.extend([85,86,87,93,94])115all_task_list.extend([100,104,105])116# all_task_list = [85,100,41,44]117# all_task_list = [41,44]118# all_task_list = [40,42,104,105]119# all_task_list = [40,42]120# all_task_list = [86,94,104,105]121# all_task_list = [86,94]122opt.embedding_list = all_task_list123if opt.nlp_embedding:...
train.py
Source:train.py
...18 else:19 raise argparse.ArgumentTypeError('Boolean value expected.')20if __name__ == '__main__':21 parser = argparse.ArgumentParser()22 parser.add_argument("-task", default='ext', type=str, choices=['ext', 'abs'])23 parser.add_argument("-encoder", default='bert', type=str, choices=['bert', 'baseline'])24 parser.add_argument("-mode", default='train', type=str, choices=['train', 'validate', 'test'])25 parser.add_argument("-bert_data_path", default='../bert_data_new/cnndm')26 parser.add_argument("-model_path", default='../models/')27 parser.add_argument("-result_path", default='../results/cnndm')28 parser.add_argument("-temp_dir", default='../temp')29 parser.add_argument("-batch_size", default=140, type=int)30 parser.add_argument("-test_batch_size", default=200, type=int)31 parser.add_argument("-max_pos", default=512, type=int)32 parser.add_argument("-use_interval", type=str2bool, nargs='?',const=True,default=True)33 parser.add_argument("-large", type=str2bool, nargs='?',const=True,default=False)34 parser.add_argument("-load_from_extractive", default='', type=str)35 parser.add_argument("-sep_optim", type=str2bool, nargs='?',const=True,default=False)36 parser.add_argument("-lr_bert", default=2e-3, type=float)37 parser.add_argument("-lr_dec", default=2e-3, type=float)38 parser.add_argument("-use_bert_emb", type=str2bool, nargs='?',const=True,default=False)39 parser.add_argument("-share_emb", type=str2bool, nargs='?', const=True, default=False)40 parser.add_argument("-finetune_bert", type=str2bool, nargs='?', const=True, default=True)41 parser.add_argument("-dec_dropout", default=0.2, type=float)42 parser.add_argument("-dec_layers", default=6, type=int)43 parser.add_argument("-dec_hidden_size", default=768, type=int)44 parser.add_argument("-dec_heads", default=8, type=int)45 parser.add_argument("-dec_ff_size", default=2048, type=int)46 parser.add_argument("-enc_hidden_size", default=512, type=int)47 parser.add_argument("-enc_ff_size", default=512, type=int)48 parser.add_argument("-enc_dropout", default=0.2, type=float)49 parser.add_argument("-enc_layers", default=6, type=int)50 # params for EXT51 parser.add_argument("-ext_dropout", default=0.2, type=float)52 parser.add_argument("-ext_layers", default=2, type=int)53 parser.add_argument("-ext_hidden_size", default=768, type=int)54 parser.add_argument("-ext_heads", default=8, type=int)55 parser.add_argument("-ext_ff_size", default=2048, type=int)56 parser.add_argument("-label_smoothing", default=0.1, type=float)57 parser.add_argument("-generator_shard_size", default=32, type=int)58 parser.add_argument("-alpha", default=0.6, type=float)59 parser.add_argument("-beam_size", default=5, type=int)60 parser.add_argument("-min_length", default=15, type=int)61 parser.add_argument("-max_length", default=150, type=int)62 parser.add_argument("-max_tgt_len", default=140, type=int)63 parser.add_argument("-param_init", default=0, type=float)64 parser.add_argument("-param_init_glorot", type=str2bool, nargs='?',const=True,default=True)65 parser.add_argument("-optim", default='adam', type=str)66 parser.add_argument("-lr", default=1, type=float)67 parser.add_argument("-beta1", default= 0.9, type=float)68 parser.add_argument("-beta2", default=0.999, type=float)69 parser.add_argument("-warmup_steps", default=8000, type=int)70 parser.add_argument("-warmup_steps_bert", default=8000, type=int)71 parser.add_argument("-warmup_steps_dec", default=8000, type=int)72 parser.add_argument("-max_grad_norm", default=0, type=float)73 parser.add_argument("-save_checkpoint_steps", default=5, type=int)74 parser.add_argument("-accum_count", default=1, type=int)75 parser.add_argument("-report_every", default=1, type=int)76 parser.add_argument("-train_steps", default=1000, type=int)77 parser.add_argument("-recall_eval", type=str2bool, nargs='?',const=True,default=False)78 parser.add_argument('-visible_gpus', default='-1', type=str)79 parser.add_argument('-gpu_ranks', default='0', type=str)80 parser.add_argument('-log_file', default='../logs/cnndm.log')81 parser.add_argument('-seed', default=666, type=int)82 parser.add_argument("-test_all", type=str2bool, nargs='?',const=True,default=False)83 parser.add_argument("-test_from", default='')84 parser.add_argument("-test_start_from", default=-1, type=int)85 parser.add_argument("-train_from", default='')86 parser.add_argument("-report_rouge", type=str2bool, nargs='?',const=True,default=True)87 parser.add_argument("-block_trigram", type=str2bool, nargs='?', const=True, default=True)88 args = parser.parse_args()89 args.gpu_ranks = [int(i) for i in range(len(args.visible_gpus.split(',')))]90 args.world_size = len(args.gpu_ranks)91 os.environ["CUDA_VISIBLE_DEVICES"] = args.visible_gpus92 init_logger(args.log_file)93 device = "cpu" if args.visible_gpus == '-1' else "cuda"94 device_id = 0 if device == "cuda" else -195 if (args.task == 'abs'):96 if (args.mode == 'train'):97 train_abs(args, device_id)98 elif (args.mode == 'validate'):99 validate_abs(args, device_id)100 elif (args.mode == 'lead'):101 baseline(args, cal_lead=True)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!