MCPcopy Create free account
hub / github.com/Zhiyuan-R/Tiger-Diffusion / main

Function main

train_generation.py:753–777  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

751 dist.destroy_process_group()
752
753def main():
754 opt = parse_args()
755 if opt.category == 'airplane':
756 opt.beta_start = 1e-5
757 opt.beta_end = 0.008
758 opt.schedule_type = 'warm0.1'
759
760 exp_id = os.path.splitext(os.path.basename(__file__))[0]
761 dir_id = os.path.dirname(__file__)
762 output_dir = get_output_dir(dir_id, exp_id)
763 copy_source(__file__, output_dir)
764
765 ''' workaround '''
766 train_dataset, _ = get_dataset(opt.dataroot, opt.npoints, opt.category)
767 noises_init = torch.randn(len(train_dataset), opt.npoints, opt.nc)
768
769 if opt.dist_url == "env://" and opt.world_size == -1:
770 opt.world_size = int(os.environ["WORLD_SIZE"])
771
772 if opt.distribution_type == 'multi':
773 opt.ngpus_per_node = torch.cuda.device_count()
774 opt.world_size = opt.ngpus_per_node * opt.world_size
775 mp.spawn(train, nprocs=opt.ngpus_per_node, args=(opt, output_dir, noises_init))
776 else:
777 train(opt.gpu, opt, output_dir, noises_init)
778
779
780

Callers 1

Calls 5

get_output_dirFunction · 0.85
copy_sourceFunction · 0.85
trainFunction · 0.85
parse_argsFunction · 0.70
get_datasetFunction · 0.70

Tested by

no test coverage detected