add np.random.seed

pull/119/head
KaiyangZhou 2019-01-09 21:15:21 +00:00
parent 10b074e9b7
commit 1dce953786
4 changed files with 4 additions and 0 deletions

View File

@ -35,6 +35,7 @@ def main():
global args
torch.manual_seed(args.seed)
np.random.seed(args.seed)
if not args.use_avai_gpus: os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu_devices
use_gpu = torch.cuda.is_available()
if args.use_cpu: use_gpu = False

View File

@ -36,6 +36,7 @@ def main():
global args
torch.manual_seed(args.seed)
np.random.seed(args.seed)
if not args.use_avai_gpus: os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu_devices
use_gpu = torch.cuda.is_available()
if args.use_cpu: use_gpu = False

View File

@ -36,6 +36,7 @@ def main():
global args
torch.manual_seed(args.seed)
np.random.seed(args.seed)
if not args.use_avai_gpus: os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu_devices
use_gpu = torch.cuda.is_available()
if args.use_cpu: use_gpu = False

View File

@ -37,6 +37,7 @@ def main():
global args
torch.manual_seed(args.seed)
np.random.seed(args.seed)
if not args.use_avai_gpus: os.environ['CUDA_VISIBLE_DEVICES'] = args.gpu_devices
use_gpu = torch.cuda.is_available()
if args.use_cpu: use_gpu = False