add 'global' keyword to args, best_rank1

pull/119/head
KaiyangZhou 2018-10-23 11:37:03 +01:00
parent e9b578a720
commit 0374e33c7c
4 changed files with 8 additions and 0 deletions

View File

@ -109,6 +109,8 @@ best_rank1 = -np.inf
def main():
global args, best_rank1
torch.manual_seed(args.seed)
if not args.use_avai_gpus: os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu_devices
use_gpu = torch.cuda.is_available()

View File

@ -114,6 +114,8 @@ best_rank1 = -np.inf
def main():
global args, best_rank1
torch.manual_seed(args.seed)
if not args.use_avai_gpus: os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu_devices
use_gpu = torch.cuda.is_available()

View File

@ -103,6 +103,8 @@ best_rank1 = -np.inf
def main():
global args, best_rank1
torch.manual_seed(args.seed)
if not args.use_avai_gpus: os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu_devices
use_gpu = torch.cuda.is_available()

View File

@ -108,6 +108,8 @@ best_rank1 = -np.inf
def main():
global args, best_rank1
torch.manual_seed(args.seed)
if not args.use_avai_gpus: os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu_devices
use_gpu = torch.cuda.is_available()