diff --git a/tools/utils.py b/tools/utils.py index ec277d7..35f2829 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -17,7 +17,9 @@ def setup_seed(seed): torch.manual_seed(seed) - torch.cuda.manual_seed_all(seed) + if torch.cuda.is_available(): + torch.cuda.manual_seed(seed) + torch.cuda.manual_seed_all(seed) np.random.seed(seed) random.seed(seed) torch.backends.cudnn.deterministic = True