Add some clearer error messages

This commit is contained in:
darkliang
2021-12-29 17:14:03 +08:00
parent bddd552907
commit 19ed960b0a
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ def run_model(cfgs, training):
if __name__ == '__main__':
torch.distributed.init_process_group('nccl', init_method='env://')
if torch.distributed.get_world_size() != torch.cuda.device_count():
raise AssertionError("Expect number of availuable GPUs({}) equals to the world size({}).".format(
raise ValueError("Expect number of availuable GPUs({}) equals to the world size({}).".format(
torch.distributed.get_world_size(), torch.cuda.device_count()))
cfgs = config_loader(opt.cfgs)
if opt.iter != 0: